Skip to content

Commit cb40314

Browse files
committed
Cleanup: NSTextAlignment.
1 parent 7957075 commit cb40314

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

Sources/DiffableTextViewsXiOS/Helpers/&NSTextAlignment.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ extension NSTextAlignment {
2424

2525
@inlinable init(_ alignment: TextAlignment, for layout: UIUserInterfaceLayoutDirection) {
2626
switch alignment {
27-
case .leading: self = .adaptive(layout, lr: .left, rl: .right)
28-
case .trailing: self = .adaptive(layout, lr: .right, rl: .left)
27+
case .leading: self = .adaptive(layout, leftToRight: .left, rightToLeft: .right)
28+
case .trailing: self = .adaptive(layout, leftToRight: .right, rightToLeft: .left)
2929
case .center: self = .center
3030
}
3131
}
@@ -35,11 +35,11 @@ extension NSTextAlignment {
3535
//=------------------------------------------------------------------------=
3636

3737
@inlinable static func adaptive(_ layout: UIUserInterfaceLayoutDirection,
38-
lr: @autoclosure () -> Self, rl: @autoclosure () -> Self) -> Self {
38+
leftToRight: @autoclosure () -> Self, rightToLeft: @autoclosure () -> Self) -> Self {
3939
switch layout {
40-
case .rightToLeft: return rl()
41-
case .leftToRight: return lr()
42-
@unknown default: return lr()
40+
case .rightToLeft: return rightToLeft()
41+
case .leftToRight: return leftToRight()
42+
@unknown default: return leftToRight()
4343
}
4444
}
4545
}

0 commit comments

Comments
 (0)