Added behaviour comment to Failable<BinaryInteger, T>.init(exactly:) doc comment

This commit is contained in:
Caleb Kleveter 2018-11-29 13:56:32 -06:00
parent 19dc564012
commit 8b8b30b4dd
No known key found for this signature in database
GPG Key ID: B38DBD5CF2C98D69
1 changed files with 2 additions and 0 deletions

View File

@ -28,6 +28,8 @@ extension Failable where T: BinaryInteger {
}
/// See [`BinaryInteger.init(exactly:)`](https://developer.apple.com/documentation/swift/binaryinteger/2925955-init).
///
/// If an error is thrown by the `Failable` initializer, then this init will return `nil`.
public init?<B>(exactly source: B) where B : BinaryFloatingPoint {
guard let t = T(exactly: source) else { return nil }
try? self.init(t)