]> git.lizzy.rs Git - rust.git/commitdiff
Be a bit more explicit asserting over the vec rather than the len
authorSantiago Pastorino <spastorino@gmail.com>
Tue, 7 May 2019 16:31:12 +0000 (13:31 -0300)
committerSantiago Pastorino <spastorino@gmail.com>
Tue, 7 May 2019 16:31:12 +0000 (13:31 -0300)
src/libcore/mem.rs

index 95480c6bf048dd5bd3af0b5ba44762cf9abc499f..ae43a7f5ffa1ee831883718d5b8c289a558aff5f 100644 (file)
@@ -666,8 +666,8 @@ pub fn swap<T>(x: &mut T, y: &mut T) {
 /// let mut v: Vec<i32> = vec![1, 2];
 ///
 /// let old_v = mem::replace(&mut v, vec![3, 4, 5]);
-/// assert_eq!(2, old_v.len());
-/// assert_eq!(3, v.len());
+/// assert_eq!(vec![1, 2], old_v);
+/// assert_eq!(vec![3, 4, 5], v);
 /// ```
 ///
 /// `replace` allows consumption of a struct field by replacing it with another value.