We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 515c4d3 commit 13f8f40Copy full SHA for 13f8f40
src/libcore/iter/mod.rs
@@ -1092,6 +1092,15 @@ impl<I> DoubleEndedIterator for Enumerate<I> where
1092
#[stable(feature = "rust1", since = "1.0.0")]
1093
impl<I> ExactSizeIterator for Enumerate<I> where I: ExactSizeIterator {}
1094
1095
+#[doc(hidden)]
1096
+unsafe impl<I> TrustedRandomAccess for Enumerate<I>
1097
+ where I: TrustedRandomAccess
1098
+{
1099
+ unsafe fn get_unchecked(&mut self, i: usize) -> (usize, I::Item) {
1100
+ (self.count + i, self.iter.get_unchecked(i))
1101
+ }
1102
+}
1103
+
1104
/// An iterator with a `peek()` that returns an optional reference to the next
1105
/// element.
1106
///
0 commit comments