mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-22 20:19:42 +00:00
Update en/src/collections/vector.md
This commit is contained in:
@ -130,7 +130,7 @@ fn main() {
|
||||
assert_eq!(slice1, slice2);
|
||||
|
||||
// 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
|
||||
let vec_ref: &mut Vec<i32> = &mut v;
|
||||
(*vec_ref).push(4);
|
||||
|
Reference in New Issue
Block a user