File tree Expand file tree Collapse file tree 2 files changed +2
-18
lines changed Expand file tree Collapse file tree 2 files changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,6 @@ public protocol StringProtocol
21
21
Hashable
22
22
where Iterator. Element == Character {
23
23
24
- // this should be just <T : StringProtocol>
25
- init <
26
- T : LosslessStringConvertible & Sequence
27
- > ( _ other: T ) where T. Iterator. Element == Character
28
-
29
24
associatedtype UTF8Index
30
25
var utf8 : String . UTF8View { get }
31
26
associatedtype UTF16Index
@@ -83,14 +78,6 @@ public protocol StringProtocol
83
78
) rethrows -> Result
84
79
}
85
80
86
- extension StringProtocol {
87
- public init <
88
- T : LosslessStringConvertible & Sequence
89
- > ( _ other: T ) where T. Iterator. Element == Character {
90
- self . init ( other. description. characters)
91
- }
92
- }
93
-
94
81
/// Call body with a pointer to zero-terminated sequence of
95
82
/// `TargetEncoding.CodeUnit` representing the same string as `source`, when
96
83
/// `source` is interpreted as being encoded with `SourceEncoding`.
Original file line number Diff line number Diff line change @@ -41,11 +41,8 @@ extension String : StringProtocol {
41
41
// - init<S>(_ characters: S) where S : Sequence, S.Iterator.Element == Character
42
42
// Cannot simply do init(_: String) as that would itself be ambiguous with
43
43
// init?(_ description: String)
44
- public init<
45
- T : LosslessStringConvertible & Sequence
46
- >(_ other: T)
47
- where T.Iterator.Element == Character {
48
- self = other.description
44
+ public init<T : StringProtocol>(_ other: T) {
45
+ self.init(other.characters)
49
46
}
50
47
51
48
/// The position of the first character in a nonempty string.
You can’t perform that action at this time.
0 commit comments