remove extension public/internal modifiers (#822)

Motivation:

public/internal modifiers for `extension`s are confusing as a
`func foo` is public if within a `public extension`.

Modifications:

remove all `internal` (redundant) and `public` (dangerous) modifiers for
`extensions`.

Result:

- code easier to read
- code much easier to review in a small diff
This commit is contained in:
Johannes Weiss authored and GitHub committed 2019-02-14 13:25:30 +00:00
1 parent f84b5b8087
commit 0ac7e2266b
18 files changed
+72 -70

No files matched your search

+4 -4
View File
@@ -81,7 +81,7 @@ extension WebSocketOpcode: CustomStringConvertible {
}
}
public extension UInt8 {
extension UInt8 {
/// Create a UInt8 corresponding to a given `WebSocketOpcode`.
///
/// This places the opcode in the four least-significant bits, in
@@ -89,18 +89,18 @@ public extension UInt8 {
///
/// - parameters:
/// - opcode: The `WebSocketOpcode`.
init(webSocketOpcode opcode: WebSocketOpcode) {
public init(webSocketOpcode opcode: WebSocketOpcode) {
precondition(opcode.networkRepresentation < 0x10)
self = opcode.networkRepresentation
}
}
public extension Int {
extension Int {
/// Create a UInt8 corresponding to the integer value for a given `WebSocketOpcode`.
///
/// - parameters:
/// - opcode: The `WebSocketOpcode`.
init(webSocketOpcode opcode: WebSocketOpcode) {
public init(webSocketOpcode opcode: WebSocketOpcode) {
precondition(opcode.networkRepresentation < 0x10)
self = Int(opcode.networkRepresentation)
}