Be a bit more explicit asserting over the vec rather than the len

This commit is contained in:
Santiago Pastorino 2019-05-07 13:31:12 -03:00
parent 7754865892
commit b98bf88d32
No known key found for this signature in database
GPG Key ID: 88C941CDA1D46432

View 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.