Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect closure names in documentation. #1025

Merged
merged 1 commit into from Jun 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 6 additions & 6 deletions Sources/NIO/ByteBuffer-aux.swift
Expand Up @@ -216,7 +216,7 @@ extension ByteBuffer {
// MARK: Other APIs

/// Yields an immutable buffer pointer containing this `ByteBuffer`'s readable bytes. Will move the reader index
/// by the number of bytes returned by `fn`.
/// by the number of bytes returned by `body`.
///
/// - warning: Do not escape the pointer from the closure for later use.
///
Expand All @@ -232,13 +232,13 @@ extension ByteBuffer {
}

/// Yields an immutable buffer pointer containing this `ByteBuffer`'s readable bytes. Will move the reader index
/// by the number of bytes `fn` returns in the first tuple component.
/// by the number of bytes `body` returns in the first tuple component.
///
/// - warning: Do not escape the pointer from the closure for later use.
///
/// - parameters:
/// - body: The closure that will accept the yielded bytes and returns the number of bytes it processed along with some other value.
/// - returns: The value `fn` returned in the second tuple component.
/// - returns: The value `body` returned in the second tuple component.
@inlinable
public mutating func readWithUnsafeReadableBytes<T>(_ body: (UnsafeRawBufferPointer) throws -> (Int, T)) rethrows -> T {
let (bytesRead, ret) = try self.withUnsafeReadableBytes(body)
Expand All @@ -247,7 +247,7 @@ extension ByteBuffer {
}

/// Yields a mutable buffer pointer containing this `ByteBuffer`'s readable bytes. You may modify the yielded bytes.
/// Will move the reader index by the number of bytes returned by `fn` but leave writer index as it was.
/// Will move the reader index by the number of bytes returned by `body` but leave writer index as it was.
///
/// - warning: Do not escape the pointer from the closure for later use.
///
Expand All @@ -263,13 +263,13 @@ extension ByteBuffer {
}

/// Yields a mutable buffer pointer containing this `ByteBuffer`'s readable bytes. You may modify the yielded bytes.
/// Will move the reader index by the number of bytes `fn` returns in the first tuple component but leave writer index as it was.
/// Will move the reader index by the number of bytes `body` returns in the first tuple component but leave writer index as it was.
///
/// - warning: Do not escape the pointer from the closure for later use.
///
/// - parameters:
/// - body: The closure that will accept the yielded bytes and returns the number of bytes it processed along with some other value.
/// - returns: The value `fn` returned in the second tuple component.
/// - returns: The value `body` returned in the second tuple component.
@inlinable
public mutating func readWithUnsafeMutableReadableBytes<T>(_ body: (UnsafeMutableRawBufferPointer) throws -> (Int, T)) rethrows -> T {
let (bytesRead, ret) = try self.withUnsafeMutableReadableBytes(body)
Expand Down
6 changes: 3 additions & 3 deletions Sources/NIO/ByteBuffer-core.swift
Expand Up @@ -466,7 +466,7 @@ public struct ByteBuffer {
///
/// - parameters:
/// - body: The closure that will accept the yielded bytes.
/// - returns: The value returned by `fn`.
/// - returns: The value returned by `body`.
@inlinable
public mutating func withUnsafeMutableReadableBytes<T>(_ body: (UnsafeMutableRawBufferPointer) throws -> T) rethrows -> T {
self._copyStorageAndRebaseIfNeeded()
Expand Down Expand Up @@ -523,7 +523,7 @@ public struct ByteBuffer {
///
/// - parameters:
/// - body: The closure that will accept the yielded bytes.
/// - returns: The value returned by `fn`.
/// - returns: The value returned by `body`.
@inlinable
public func withUnsafeReadableBytes<T>(_ body: (UnsafeRawBufferPointer) throws -> T) rethrows -> T {
let readerIndex = self.readerIndex
Expand All @@ -540,7 +540,7 @@ public struct ByteBuffer {
///
/// - parameters:
/// - body: The closure that will accept the yielded bytes and the `storageManagement`.
/// - returns: The value returned by `fn`.
/// - returns: The value returned by `body`.
@inlinable
public func withUnsafeReadableBytesWithStorageManagement<T>(_ body: (UnsafeRawBufferPointer, Unmanaged<AnyObject>) throws -> T) rethrows -> T {
let storageReference: Unmanaged<AnyObject> = Unmanaged.passUnretained(self._storage)
Expand Down
2 changes: 1 addition & 1 deletion Sources/NIO/Selector.swift
Expand Up @@ -469,7 +469,7 @@ final class Selector<R: Registration> {
}
}

/// Apply the given `SelectorStrategy` and execute `fn` once it's complete (which may produce `SelectorEvent`s to handle).
/// Apply the given `SelectorStrategy` and execute `body` once it's complete (which may produce `SelectorEvent`s to handle).
///
/// - parameters:
/// - strategy: The `SelectorStrategy` to apply
Expand Down
2 changes: 1 addition & 1 deletion Sources/NIO/Thread.swift
Expand Up @@ -54,7 +54,7 @@ final class NIOThread {
///
/// - parameters:
/// - body: The closure that will accept the `pthread_t`.
/// - returns: The value returned by `fn`.
/// - returns: The value returned by `body`.
func withUnsafePthread<T>(_ body: (pthread_t) throws -> T) rethrows -> T {
return try body(self.pthread)
}
Expand Down