diff --git a/Sources/NIO/ByteBuffer-int.swift b/Sources/NIO/ByteBuffer-int.swift index 1280eaa95..02d19f966 100644 --- a/Sources/NIO/ByteBuffer-int.swift +++ b/Sources/NIO/ByteBuffer-int.swift @@ -103,7 +103,7 @@ extension ByteBuffer { extension FixedWidthInteger { /// Returns the next power of two. - public func nextPowerOf2() -> Self { + func nextPowerOf2() -> Self { guard self != 0 else { return 1 } @@ -115,7 +115,7 @@ extension UInt32 { /// Returns the next power of two unless that would overflow, in which case UInt32.max (on 64-bit systems) or /// Int32.max (on 32-bit systems) is returned. The returned value is always safe to be cast to Int and passed /// to malloc on all platforms. - public func nextPowerOf2ClampedToMax() -> UInt32 { + func nextPowerOf2ClampedToMax() -> UInt32 { guard self > 0 else { return 1 } diff --git a/Sources/NIO/CircularBuffer.swift b/Sources/NIO/CircularBuffer.swift index 63597147d..45078f077 100644 --- a/Sources/NIO/CircularBuffer.swift +++ b/Sources/NIO/CircularBuffer.swift @@ -16,7 +16,7 @@ /// RangeReplaceableCollection. It defines the append method that is present /// on RangeReplaceableCollection, which makes all RangeReplaceableCollections /// trivially able to implement this protocol. -public protocol AppendableCollection: Collection { +protocol AppendableCollection: Collection { mutating func append(_ newElement: Self.Iterator.Element) } diff --git a/Sources/NIO/IO.swift b/Sources/NIO/IO.swift index 316a6883c..1f614ee47 100644 --- a/Sources/NIO/IO.swift +++ b/Sources/NIO/IO.swift @@ -79,7 +79,7 @@ extension IOError: CustomStringConvertible { } /// An result for an IO operation that was done on a non-blocking resource. -public enum IOResult { +enum IOResult { /// Signals that the IO operation could not be completed as otherwise we would need to block. case wouldBlock(T) diff --git a/Sources/NIO/Socket.swift b/Sources/NIO/Socket.swift index 433dc4bbb..3119c1518 100644 --- a/Sources/NIO/Socket.swift +++ b/Sources/NIO/Socket.swift @@ -13,7 +13,7 @@ //===----------------------------------------------------------------------===// /// The container used for writing multiple buffers via `writev`. -public typealias IOVector = iovec +typealias IOVector = iovec // TODO: scattering support /* final but tests */ class Socket: BaseSocket {