about summary refs log tree commit diff
path: root/src/libcollections
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-05-04 04:05:37 +0000
committerbors <bors@rust-lang.org>2015-05-04 04:05:37 +0000
commit6517a0e90ef607227eec3e888707c36bf191fd09 (patch)
tree3675a310f3790844a9cfaa413ba7f1ae6ae21415 /src/libcollections
parent45b9a34a7b0ad3ccf85cd8f5a92cfe2e01861e69 (diff)
parent5d8431c20387531d7dcbb6ad3841d15fe41b3c09 (diff)
Auto merge of #25047 - sinkuu:vec_intoiter_override, r=alexcrichton
Override methods `count`, `last`, and `nth` in vec::IntoIter.

#24214
Diffstat (limited to 'src/libcollections')
-rw-r--r--src/libcollections/vec.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcollections/vec.rs b/src/libcollections/vec.rs
index 33de6b79736..935648099a7 100644
--- a/src/libcollections/vec.rs
+++ b/src/libcollections/vec.rs
@@ -1777,6 +1777,11 @@ impl<T> Iterator for IntoIter<T> {
         let exact = diff / (if size == 0 {1} else {size});
         (exact, Some(exact))
     }
+
+    #[inline]
+    fn count(self) -> usize {
+        self.size_hint().0
+    }
 }
 
 #[stable(feature = "rust1", since = "1.0.0")]