Skip to content

Commit c23a77f

Browse files
committed
Fix RangeReplaceableCollection conformance by switching SubSequence to RangeReplaceableRandomAccessSlice.
1 parent 43f5296 commit c23a77f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Sources/Deque.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ extension Deque: RandomAccessCollection, MutableCollection {
9393
public typealias Index = Int
9494
public typealias Indices = CountableRange<Int>
9595
public typealias Iterator = IndexingIterator<Deque<Element>>
96+
public typealias SubSequence = RangeReplaceableRandomAccessSlice<Deque<Element>>
9697

9798
/// The number of elements currently stored in this deque.
9899
public var count: Int { return buffer.count }
@@ -170,9 +171,9 @@ extension Deque: RandomAccessCollection, MutableCollection {
170171
}
171172

172173
/// Accesses a contiguous subrange of the collection’s elements.
173-
public subscript(bounds: Range<Int>) -> RandomAccessSlice<Deque<Element>> {
174+
public subscript(bounds: Range<Int>) -> RangeReplaceableRandomAccessSlice<Deque<Element>> {
174175
get {
175-
return RandomAccessSlice(base: self, bounds: bounds)
176+
return RangeReplaceableRandomAccessSlice(base: self, bounds: bounds)
176177
}
177178
set {
178179
self.replaceSubrange(bounds, with: newValue)

0 commit comments

Comments
 (0)