Skip to content

Commit

Permalink
Better generic name
Browse files Browse the repository at this point in the history
  • Loading branch information
glbrntt committed Jul 18, 2024
1 parent a9dd8d8 commit c3af639
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Sources/NIOConcurrencyHelpers/NIOLockedValueBox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,13 @@ public struct NIOLockedValueBox<Value> {
}

/// Mutate the value, assuming the lock has been acquired manually.
///
/// - Parameter mutate: A closure with scoped access to the value.
/// - Returns: The result of the `mutate` closure.
@inlinable
public func withValueAssumingLockIsAcquired<T>(
_ mutate: (inout Value) throws -> T
) rethrows -> T {
public func withValueAssumingLockIsAcquired<Result>(
_ mutate: (_ value: inout Value) throws -> Result
) rethrows -> Result {
return try self._storage.withUnsafeMutablePointerToHeader { value in
try mutate(&value.pointee)
}
Expand Down

0 comments on commit c3af639

Please sign in to comment.