File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -322,7 +322,8 @@ extension Substring: CustomDebugStringConvertible {
322
322
323
323
extension Substring : LosslessStringConvertible {
324
324
public init ( _ content: String ) {
325
- self = content [ ... ]
325
+ let range = Range ( _uncheckedBounds: ( content. startIndex, content. endIndex) )
326
+ self . init ( Slice ( base: content, bounds: range) )
326
327
}
327
328
}
328
329
@@ -727,14 +728,14 @@ extension Substring: RangeReplaceableCollection {
727
728
public init < S: Sequence > ( _ elements: S )
728
729
where S. Element == Character {
729
730
if let str = elements as? String {
730
- self = str [ ... ]
731
+ self . init ( str )
731
732
return
732
733
}
733
734
if let subStr = elements as? Substring {
734
735
self = subStr
735
736
return
736
737
}
737
- self = String ( elements) [ ... ]
738
+ self . init ( String ( elements) )
738
739
}
739
740
740
741
@inlinable // specialize
You can’t perform that action at this time.
0 commit comments