Skip to content

Commit 3f67313

Browse files
committed
[gardening] formatting adjustments
1 parent ba416cd commit 3f67313

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

stdlib/public/core/UnsafePointer.swift

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,9 @@ public struct UnsafePointer<Pointee>: _Pointer {
266266
/// pointer to `Int64`, then accesses a property on the signed integer.
267267
///
268268
/// let uint64Pointer: UnsafePointer<UInt64> = fetchValue()
269-
/// let isNegative = uint64Pointer.withMemoryRebound(to: Int64.self,
270-
/// capacity: 1) {
269+
/// let isNegative = uint64Pointer.withMemoryRebound(
270+
/// to: Int64.self, capacity: 1
271+
/// ) {
271272
/// return $0.pointee < 0
272273
/// }
273274
///
@@ -308,7 +309,8 @@ public struct UnsafePointer<Pointee>: _Pointer {
308309
// This custom silgen name is chosen to not interfere with the old ABI
309310
@_silgen_name("_swift_se0333_UnsafePointer_withMemoryRebound")
310311
public func withMemoryRebound<T, Result>(
311-
to type: T.Type, capacity count: Int,
312+
to type: T.Type,
313+
capacity count: Int,
312314
_ body: (_ pointer: UnsafePointer<T>) throws -> Result
313315
) rethrows -> Result {
314316
_debugPrecondition(
@@ -952,8 +954,8 @@ public struct UnsafeMutablePointer<Pointee>: _Pointer {
952954
/// pointer to `Int64`, then modifies the signed integer.
953955
///
954956
/// let uint64Pointer: UnsafeMutablePointer<UInt64> = fetchValue()
955-
/// uint64Pointer.withMemoryRebound(to: Int64.self, capacity: 1) { ptr in
956-
/// ptr.pointee.negate()
957+
/// uint64Pointer.withMemoryRebound(to: Int64.self, capacity: 1) {
958+
/// $0.pointee.negate()
957959
/// }
958960
///
959961
/// Because this pointer's memory is no longer bound to its `Pointee` type
@@ -993,7 +995,8 @@ public struct UnsafeMutablePointer<Pointee>: _Pointer {
993995
// This custom silgen name is chosen to not interfere with the old ABI
994996
@_silgen_name("$_swift_se0333_UnsafeMutablePointer_withMemoryRebound")
995997
public func withMemoryRebound<T, Result>(
996-
to type: T.Type, capacity count: Int,
998+
to type: T.Type,
999+
capacity count: Int,
9971000
_ body: (_ pointer: UnsafeMutablePointer<T>) throws -> Result
9981001
) rethrows -> Result {
9991002
_debugPrecondition(

stdlib/public/core/UnsafeRawPointer.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,9 @@ public struct UnsafeRawPointer: _Pointer {
339339
/// to `Int64`, then accesses a property on the signed integer.
340340
///
341341
/// let pointer: UnsafeRawPointer = fetchValue()
342-
/// let isNegative = pointer.withMemoryRebound(to: Int64.self,
343-
/// capacity: 1) {
342+
/// let isNegative = pointer.withMemoryRebound(
343+
/// to: Int64.self, capacity: 1
344+
/// ) {
344345
/// return $0.pointee < 0
345346
/// }
346347
///
@@ -780,7 +781,7 @@ public struct UnsafeMutableRawPointer: _Pointer {
780781
///
781782
/// let pointer: UnsafeMutableRawPointer = fetchValue()
782783
/// pointer.withMemoryRebound(to: Int64.self, capacity: 1) {
783-
/// ptr.pointee.negate()
784+
/// $0.pointee.negate()
784785
/// }
785786
///
786787
/// After executing `body`, this method rebinds memory back to its original

0 commit comments

Comments
 (0)