diff options
| author | Mazdak Farrokhzad <twingoow@gmail.com> | 2019-05-07 19:30:11 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-05-07 19:30:11 +0200 |
| commit | 2d6da83763f934b392dd4c71b083922355ef8c87 (patch) | |
| tree | 034b4b29e11d907c25c779b71e33a6340ec6b70b | |
| parent | 9995bb58554cacb6573d672509cdf8d2e9e86ed3 (diff) | |
| parent | b98bf88d3244cc5518b6ad9302f179c1e6d11a9e (diff) | |
| download | rust-2d6da83763f934b392dd4c71b083922355ef8c87.tar.gz rust-2d6da83763f934b392dd4c71b083922355ef8c87.zip | |
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
| -rw-r--r-- | src/libcore/mem.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/mem.rs b/src/libcore/mem.rs index 5bd442bc066..9fb071d2952 100644 --- a/src/libcore/mem.rs +++ b/src/libcore/mem.rs @@ -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. |
