]> git.lizzy.rs Git - rust.git/commitdiff
impl AsRef<[T]> for vec::IntoIter<T>
authorCAD97 <cad97@cad97.com>
Mon, 25 May 2020 19:16:31 +0000 (15:16 -0400)
committerCAD97 <cad97@cad97.com>
Mon, 25 May 2020 19:17:28 +0000 (15:17 -0400)
src/liballoc/vec.rs

index d26cd77aae4b7120e9ca0a04fbd885b6bf942556..9e887cf446e70ec9c0ad293b07c499e1878188aa 100644 (file)
@@ -2603,6 +2603,13 @@ fn as_raw_mut_slice(&mut self) -> *mut [T] {
     }
 }
 
+#[stable(feature = "vec_intoiter_as_ref", since = "1.46.0")]
+impl<T> AsRef<[T]> for IntoIter<T> {
+    fn as_ref(&self) -> &[T] {
+        self.as_slice()
+    }
+}
+
 #[stable(feature = "rust1", since = "1.0.0")]
 unsafe impl<T: Send> Send for IntoIter<T> {}
 #[stable(feature = "rust1", since = "1.0.0")]