Skip to content
New issue

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

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

Already on GitHub? # to your account

Fixed minor typos and updated force unwraps. #273

Merged
merged 1 commit into from
Apr 4, 2018
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Sources/NIO/Codec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ extension ByteToMessageDecoder {
/// Calls `decode` until there is nothing left to decode.
public func channelRead(ctx: ChannelHandlerContext, data: NIOAny) {
var buffer = self.unwrapInboundIn(data)

if self.cumulationBuffer != nil {
self.cumulationBuffer!.write(buffer: &buffer)
buffer = self.cumulationBuffer!
Expand Down
2 changes: 1 addition & 1 deletion Sources/NIO/EventLoopFuture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ public struct EventLoopPromise<T> {
///
/// This means that for any `EventLoopFuture` that your code did not create itself (via
/// `EventLoopPromise.futureResult`), use of `hopTo` is **strongly encouraged** to help guarantee thread-safety. It
/// should only be elided when thread-safety is proved to be not needed.
/// should only be elided when thread-safety is provably not needed.
///
/// The "thread affinity" of `EventLoopFuture`s is critical to writing safe, performant concurrent code without
/// boilerplate. It allows you to avoid needing to write or use locks in your own code, instead using the natural
Expand Down
7 changes: 3 additions & 4 deletions Sources/NIOChatServer/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,10 @@ let channel = try { () -> Channel in
}
}()

if let localAddress = channel.localAddress {
print("ChatServer started and listening on \(localAddress)")
} else {
print("ChatServer started but the address could not be determined.")
guard let localAddress = channel.localAddress else {
fatalError("Address was unable to bind. Please check that the socket was not closed or that the address family was understood.")
}
print("Server started and listening on \(localAddress)")

// This will never unblock as we don't close the ServerChannel.
try channel.closeFuture.wait()
Expand Down
7 changes: 3 additions & 4 deletions Sources/NIOHTTP1Server/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -498,11 +498,10 @@ let channel = try { () -> Channel in
}
}()

if let localAddress = channel.localAddress {
print("Server started and listening on \(localAddress), htdocs path \(htdocs)")
} else {
print("Server started but the address could not be determined, htdocs path \(htdocs)")
guard let localAddress = channel.localAddress else {
fatalError("Address was unable to bind. Please check that the socket was not closed or that the address family was understood.")
}
print("Server started and listening on \(localAddress), htdocs path \(htdocs)")

// This will never unblock as we don't close the ServerChannel
try channel.closeFuture.wait()
Expand Down
7 changes: 3 additions & 4 deletions Sources/NIOWebSocketServer/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -264,11 +264,10 @@ let channel = try { () -> Channel in
}
}()

if let localAddress = channel.localAddress {
print("Server started and listening on \(localAddress)")
} else {
print("Server started but the address could not be determined.")
guard let localAddress = channel.localAddress else {
fatalError("Address was unable to bind. Please check that the socket was not closed or that the address family was understood.")
}
print("Server started and listening on \(localAddress)")

// This will never unblock as we don't close the ServerChannel
try channel.closeFuture.wait()
Expand Down