mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Revert "[stdlib] Removing a String.init?(_: String), non-failable is enough"
This reverts commit 46415e7dbd.
This commit is contained in:
committed by
Maxim Moiseev
parent
a5a59f5aed
commit
f8bb0d88d7
@@ -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`.
|
||||
|
||||
Reference in New Issue
Block a user