Skip to content

Commit d852ff9

Browse files
airspeedswiftBen Cohen
authored andcommitted
Account for Substring update
1 parent 7f47f50 commit d852ff9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stdlib/public/core/Substring.swift.gyb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ public struct Substring : RangeReplaceableCollection, BidirectionalCollection {
3232
_slice = RangeReplaceableBidirectionalSlice(base: base, bounds: bounds)
3333
}
3434

35-
internal init(_base base: String, _ bounds: ClosedRange<Index>) {
36-
self.init(_base: base, base._makeHalfOpen(bounds))
35+
internal init<R: RangeExpression>(_base base: String, _ bounds: R) where R.Bound == Index {
36+
self.init(_base: base, bounds.relative(to: base))
3737
}
3838

3939
public var startIndex: Index { return _slice.startIndex }

0 commit comments

Comments
 (0)