Skip to content

Commit

Permalink
Rollup merge of #60609 - spastorino:be-explicit-on-mem-replace-doc, r…
Browse files Browse the repository at this point in the history
…=Centril

Be a bit more explicit asserting over the vec rather than the len
  • Loading branch information
Centril authored May 7, 2019
2 parents 9995bb5 + b98bf88 commit 2d6da83
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libcore/mem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -665,8 +665,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.
Expand Down

0 comments on commit 2d6da83

Please sign in to comment.