mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 04:29:41 +00:00
Update en/src/collections/vector.md
This commit is contained in:
@ -130,7 +130,7 @@ fn main() {
|
|||||||
assert_eq!(slice1, slice2);
|
assert_eq!(slice1, slice2);
|
||||||
|
|
||||||
// A slice can also be mutable, in which
|
// A slice can also be mutable, in which
|
||||||
// case mutating it will mutate its underlying Vec
|
// case mutating it will mutate its underlying Vec.
|
||||||
// Note: slice and &Vec are different
|
// Note: slice and &Vec are different
|
||||||
let vec_ref: &mut Vec<i32> = &mut v;
|
let vec_ref: &mut Vec<i32> = &mut v;
|
||||||
(*vec_ref).push(4);
|
(*vec_ref).push(4);
|
||||||
|
Reference in New Issue
Block a user