Skip to content

Commit 6401324

Browse files
committed
[stdlib] Apply tail style "where" clause to stdlib/{internal,private}
1 parent 668b9db commit 6401324

12 files changed

+406
-475
lines changed

stdlib/internal/SwiftExperimental/SwiftExperimental.swift

Lines changed: 30 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -63,51 +63,44 @@ infix operator ⊇ { associativity left precedence 130 }
6363
infix operator { associativity left precedence 130 }
6464

6565
/// - Returns: The relative complement of `lhs` with respect to `rhs`.
66-
public func <
67-
T, S: Sequence where S.Iterator.Element == T
68-
>(lhs: Set<T>, rhs: S) -> Set<T> {
66+
public func <T, S: Sequence>(lhs: Set<T>, rhs: S) -> Set<T>
67+
where S.Iterator.Element == T {
6968
return lhs.subtracting(rhs)
7069
}
7170

7271
/// Assigns the relative complement between `lhs` and `rhs` to `lhs`.
73-
public func ∖= <
74-
T, S: Sequence where S.Iterator.Element == T
75-
>(lhs: inout Set<T>, rhs: S) {
72+
public func ∖= <T, S: Sequence>(lhs: inout Set<T>, rhs: S)
73+
where S.Iterator.Element == T {
7674
lhs.subtract(rhs)
7775
}
7876

7977
/// - Returns: The union of `lhs` and `rhs`.
80-
public func <
81-
T, S: Sequence where S.Iterator.Element == T
82-
>(lhs: Set<T>, rhs: S) -> Set<T> {
78+
public func <T, S: Sequence>(lhs: Set<T>, rhs: S) -> Set<T>
79+
where S.Iterator.Element == T {
8380
return lhs.union(rhs)
8481
}
8582

8683
/// Assigns the union of `lhs` and `rhs` to `lhs`.
87-
public func ∪= <
88-
T, S: Sequence where S.Iterator.Element == T
89-
>(lhs: inout Set<T>, rhs: S) {
84+
public func ∪= <T, S: Sequence>(lhs: inout Set<T>, rhs: S)
85+
where S.Iterator.Element == T {
9086
lhs.formUnion(rhs)
9187
}
9288

9389
/// - Returns: The intersection of `lhs` and `rhs`.
94-
public func <
95-
T, S: Sequence where S.Iterator.Element == T
96-
>(lhs: Set<T>, rhs: S) -> Set<T> {
90+
public func <T, S: Sequence>(lhs: Set<T>, rhs: S) -> Set<T>
91+
where S.Iterator.Element == T {
9792
return lhs.intersection(rhs)
9893
}
9994

10095
/// Assigns the intersection of `lhs` and `rhs` to `lhs`.
101-
public func ∩= <
102-
T, S: Sequence where S.Iterator.Element == T
103-
>(lhs: inout Set<T>, rhs: S) {
96+
public func ∩= <T, S: Sequence>(lhs: inout Set<T>, rhs: S)
97+
where S.Iterator.Element == T {
10498
lhs.formIntersection(rhs)
10599
}
106100

107101
/// - Returns: A set with elements in `lhs` or `rhs` but not in both.
108-
public func <
109-
T, S: Sequence where S.Iterator.Element == T
110-
>(lhs: Set<T>, rhs: S) -> Set<T> {
102+
public func <T, S: Sequence>(lhs: Set<T>, rhs: S) -> Set<T>
103+
where S.Iterator.Element == T {
111104
return lhs.symmetricDifference(rhs)
112105
}
113106

@@ -129,57 +122,49 @@ public func ∉ <T>(x: T, rhs: Set<T>) -> Bool {
129122
}
130123

131124
/// - Returns: True if `lhs` is a strict subset of `rhs`.
132-
public func <
133-
T, S: Sequence where S.Iterator.Element == T
134-
>(lhs: Set<T>, rhs: S) -> Bool {
125+
public func <T, S: Sequence>(lhs: Set<T>, rhs: S) -> Bool
126+
where S.Iterator.Element == T {
135127
return lhs.isStrictSubset(of: rhs)
136128
}
137129

138130
/// - Returns: True if `lhs` is not a strict subset of `rhs`.
139-
public func <
140-
T, S: Sequence where S.Iterator.Element == T
141-
>(lhs: Set<T>, rhs: S) -> Bool {
131+
public func <T, S: Sequence>(lhs: Set<T>, rhs: S) -> Bool
132+
where S.Iterator.Element == T {
142133
return !lhs.isStrictSubset(of: rhs)
143134
}
144135

145136
/// - Returns: True if `lhs` is a subset of `rhs`.
146-
public func <
147-
T, S: Sequence where S.Iterator.Element == T
148-
>(lhs: Set<T>, rhs: S) -> Bool {
137+
public func <T, S: Sequence>(lhs: Set<T>, rhs: S) -> Bool
138+
where S.Iterator.Element == T {
149139
return lhs.isSubset(of: rhs)
150140
}
151141

152142
/// - Returns: True if `lhs` is not a subset of `rhs`.
153-
public func <
154-
T, S: Sequence where S.Iterator.Element == T
155-
>(lhs: Set<T>, rhs: S) -> Bool {
143+
public func <T, S: Sequence>(lhs: Set<T>, rhs: S) -> Bool
144+
where S.Iterator.Element == T {
156145
return !lhs.isSubset(of: rhs)
157146
}
158147

159148
/// - Returns: True if `lhs` is a strict superset of `rhs`.
160-
public func <
161-
T, S: Sequence where S.Iterator.Element == T
162-
>(lhs: Set<T>, rhs: S) -> Bool {
149+
public func <T, S: Sequence>(lhs: Set<T>, rhs: S) -> Bool
150+
where S.Iterator.Element == T {
163151
return lhs.isStrictSuperset(of: rhs)
164152
}
165153

166154
/// - Returns: True if `lhs` is not a strict superset of `rhs`.
167-
public func <
168-
T, S: Sequence where S.Iterator.Element == T
169-
>(lhs: Set<T>, rhs: S) -> Bool {
155+
public func <T, S: Sequence>(lhs: Set<T>, rhs: S) -> Bool
156+
where S.Iterator.Element == T {
170157
return !lhs.isStrictSuperset(of: rhs)
171158
}
172159

173160
/// - Returns: True if `lhs` is a superset of `rhs`.
174-
public func <
175-
T, S: Sequence where S.Iterator.Element == T
176-
>(lhs: Set<T>, rhs: S) -> Bool {
161+
public func <T, S: Sequence>(lhs: Set<T>, rhs: S) -> Bool
162+
where S.Iterator.Element == T {
177163
return lhs.isSuperset(of: rhs)
178164
}
179165

180166
/// - Returns: True if `lhs` is not a superset of `rhs`.
181-
public func <
182-
T, S: Sequence where S.Iterator.Element == T
183-
>(lhs: Set<T>, rhs: S) -> Bool {
167+
public func <T, S: Sequence>(lhs: Set<T>, rhs: S) -> Bool
168+
where S.Iterator.Element == T {
184169
return !lhs.isSuperset(of: rhs)
185170
}

0 commit comments

Comments
 (0)