Skip to content

Commit b92dccd

Browse files
committed
Style fixes
1 parent f9ca2a2 commit b92dccd

File tree

3 files changed

+23
-17
lines changed

3 files changed

+23
-17
lines changed

benchmark/single-source/StringInterpolation.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ public let StringInterpolationManySmallSegments = BenchmarkInfo(
2525
runFunction: run_StringInterpolationManySmallSegments,
2626
tags: [.validation, .api, .String])
2727
public let CustomStringInterpolation = BenchmarkInfo(
28-
name: "CustomStringInterpolation",
29-
runFunction: run_CustomStringInterpolation,
30-
tags: [.validation, .api, .String])
28+
name: "CustomStringInterpolation",
29+
runFunction: run_CustomStringInterpolation,
30+
tags: [.validation, .api, .String])
3131
public let CustomStringNoInterpolation = BenchmarkInfo(
32-
name: "CustomStringNoInterpolation",
33-
runFunction: run_CustomStringNoInterpolation,
34-
tags: [.validation, .api, .String])
32+
name: "CustomStringNoInterpolation",
33+
runFunction: run_CustomStringNoInterpolation,
34+
tags: [.validation, .api, .String])
3535

3636
class RefTypePrintable : CustomStringConvertible {
3737
var description: String {
@@ -40,11 +40,11 @@ class RefTypePrintable : CustomStringConvertible {
4040
}
4141

4242
struct CustomString: ExpressibleByStringInterpolation {
43-
var value: String
44-
45-
init(stringLiteral: String) {
46-
self.value = stringLiteral
47-
}
43+
var value: String
44+
45+
init(stringLiteral: String) {
46+
self.value = stringLiteral
47+
}
4848
}
4949

5050
@inline(never)

stdlib/public/core/StringGuts.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ extension _StringGuts {
985985
mutating func append<S: StringProtocol>(_ other: S) {
986986
self.append(other._wholeString._guts, range: other._encodedOffsetRange)
987987
}
988-
988+
989989
@inlinable // @testable
990990
internal
991991
mutating func append(_ other: _StringGuts) {

stdlib/public/core/StringInterpolation.swift

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ public struct DefaultStringInterpolation: StringInterpolationProtocol {
105105
/// print(message)
106106
/// // Prints "If one cookie costs 2 dollars, 3 cookies cost 6 dollars."
107107
@inlinable
108-
public mutating func appendInterpolation<T: TextOutputStreamable & CustomStringConvertible>(_ value: T) {
108+
public mutating func appendInterpolation<T>(_ value: T)
109+
where T: TextOutputStreamable, T: CustomStringConvertible
110+
{
109111
value.write(to: &_storage)
110112
}
111113

@@ -125,7 +127,9 @@ public struct DefaultStringInterpolation: StringInterpolationProtocol {
125127
/// print(message)
126128
/// // Prints "If one cookie costs 2 dollars, 3 cookies cost 6 dollars."
127129
@inlinable
128-
public mutating func appendInterpolation<T: TextOutputStreamable>(_ value: T) {
130+
public mutating func appendInterpolation<T>(_ value: T)
131+
where T: TextOutputStreamable
132+
{
129133
value.write(to: &_storage)
130134
}
131135

@@ -147,7 +151,9 @@ public struct DefaultStringInterpolation: StringInterpolationProtocol {
147151
/// print(message)
148152
/// // Prints "If one cookie costs 2 dollars, 3 cookies cost 6 dollars."
149153
@inlinable
150-
public mutating func appendInterpolation<T: CustomStringConvertible>(_ value: T) {
154+
public mutating func appendInterpolation<T>(_ value: T)
155+
where T: CustomStringConvertible
156+
{
151157
_storage += value.description
152158
}
153159

@@ -188,8 +194,8 @@ extension DefaultStringInterpolation: CustomStringConvertible {
188194
}
189195
}
190196

191-
// While not strictly necessary, declaring these is faster than using the default
192-
// implementation.
197+
// While not strictly necessary, declaring these is faster than using the
198+
// default implementation.
193199
extension String {
194200
/// Creates a new instance from an interpolated string literal.
195201
///

0 commit comments

Comments
 (0)