Skip to content

Commit 2d6da83

Browse files
authored
Rollup merge of #60609 - spastorino:be-explicit-on-mem-replace-doc, r=Centril
Be a bit more explicit asserting over the vec rather than the len
2 parents 9995bb5 + b98bf88 commit 2d6da83

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libcore/mem.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -665,8 +665,8 @@ pub fn swap<T>(x: &mut T, y: &mut T) {
665665
/// let mut v: Vec<i32> = vec![1, 2];
666666
///
667667
/// let old_v = mem::replace(&mut v, vec![3, 4, 5]);
668-
/// assert_eq!(2, old_v.len());
669-
/// assert_eq!(3, v.len());
668+
/// assert_eq!(vec![1, 2], old_v);
669+
/// assert_eq!(vec![3, 4, 5], v);
670670
/// ```
671671
///
672672
/// `replace` allows consumption of a struct field by replacing it with another value.

0 commit comments

Comments
 (0)