Revert "[stdlib] Removing a String.init?(_: String), non-failable is enough"

This reverts commit 46415e7dbd.
This commit is contained in:
Max Moiseev
2017-05-12 17:47:42 -07:00
committed by Maxim Moiseev
parent a5a59f5aed
commit f8bb0d88d7

View File

@@ -78,6 +78,12 @@ public protocol StringProtocol
) rethrows -> Result
}
extension StringProtocol /* : LosslessStringConvertible */ {
public init?(_ description: String) {
self.init(description.characters)
}
}
/// Call body with a pointer to zero-terminated sequence of
/// `TargetEncoding.CodeUnit` representing the same string as `source`, when
/// `source` is interpreted as being encoded with `SourceEncoding`.