Infer return types

Motivation:

Removes unncessary explicit types that are inferred.

Modifications:

Infer types that are being returned from a function or computed variable.

Result:

Cleans up the code.
This commit is contained in:
Bas Broek 2018-03-03 08:53:08 +01:00 committed by Norman Maurer
parent b180113d81
commit 1db0be8ed9
2 changed files with 4 additions and 4 deletions

View File

@ -920,11 +920,11 @@ private extension CloseMode {
var error: ChannelError {
switch self {
case .all:
return ChannelError.alreadyClosed
return .alreadyClosed
case .output:
return ChannelError.outputClosed
return .outputClosed
case .input:
return ChannelError.inputClosed
return .inputClosed
}
}
}

View File

@ -333,7 +333,7 @@ final class PendingStreamWritesManager: PendingWritesManager {
return try triggerScalarFileWrite(scalarFileWriteOperation)
case .nothingToBeWritten:
assertionFailure("called \(#function) with nothing available to be written")
return OneWriteOperationResult.writtenCompletely
return .writtenCompletely
}
}
}