vector/slicing - improve the phrasing

This commit is contained in:
mckzm
2024-06-15 13:40:17 +09:00
committed by GitHub
parent fd0c2c50c1
commit a637487fad

View File

@ -129,8 +129,8 @@ fn main() {
assert_eq!(slice1, slice2); assert_eq!(slice1, slice2);
// Slices can also be mutable, in which // A slice can also be mutable, in which
// case mutating them will mutate the 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);