Skip to content

Commit

Permalink
Remove whitespace & improve code formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSundell committed Apr 11, 2017
1 parent 3d4a3b9 commit 44d5266
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Sources/Require.swift
Expand Up @@ -23,20 +23,24 @@ public extension Optional {
line: UInt = #line) -> Wrapped {
guard let unwrapped = self else {
var message = "Required value was nil in \(file), at line \(line)"

if let hint = hintExpression() {
message.append(". Debugging hint: \(hint)")
}

#if !os(Linux)
let exception = NSException(
name: .invalidArgumentException,
reason: message,
userInfo: nil
)
exception.raise()
let exception = NSException(
name: .invalidArgumentException,
reason: message,
userInfo: nil
)

exception.raise()
#endif

preconditionFailure(message)
}

return unwrapped
}
}

0 comments on commit 44d5266

Please sign in to comment.