SE-0138: Minor update. Array.withUnsafeBytes is nonmutating.

The "mutating" keyword should not have been on this API. The example
code in SE-0138 uses it as a nonmutating API.

(The mutating keyword was a temporary workaround that should never
have been carried over to the swift-3.0-branch).

<rdar://28614519> [swift-3.0-branch] Remove "mutating" keyword from Array.withUnsafeBytes
This commit is contained in:
Andrew Trick
2016-10-04 12:39:18 -07:00
parent 9a5a26b20c
commit 0a448ea74b
2 changed files with 3 additions and 3 deletions

View File

@@ -2170,7 +2170,7 @@ extension ${Self} {
/// - Returns: The return value of the `body` closure parameter, if any.
///
/// - SeeAlso: `withUnsafeBytes`, `UnsafeRawBufferPointer`
public mutating func withUnsafeBytes<R>(
public func withUnsafeBytes<R>(
_ body: (UnsafeRawBufferPointer) throws -> R
) rethrows -> R {
return try self.withUnsafeBufferPointer {