Skip to content

Commit 4b4d345

Browse files
authored
Merge pull request sunface#476 from Scott169/master
Correction of problem 1 in vector.md
2 parents 700a2b6 + 6990f89 commit 4b4d345

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

en/src/collections/vector.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,26 @@ fn main() {
99
let arr: [u8; 3] = [1, 2, 3];
1010
1111
let v = Vec::from(arr);
12-
is_vec(v);
12+
is_vec(&v);
1313
1414
let v = vec![1, 2, 3];
15-
is_vec(v);
15+
is_vec(&v);
1616
1717
// vec!(..) and vec![..] are same macros, so
1818
let v = vec!(1, 2, 3);
19-
is_vec(v);
19+
is_vec(&v);
2020
2121
// In code below, v is Vec<[u8; 3]> , not Vec<u8>
2222
// USE Vec::new and `for` to rewrite the below code
2323
let v1 = vec!(arr);
24-
is_vec(v1);
24+
is_vec(&v1);
2525
2626
assert_eq!(v, v1);
2727
2828
println!("Success!");
2929
}
3030
31-
fn is_vec(v: Vec<u8>) {}
31+
fn is_vec(v: &Vec<u8>) {}
3232
```
3333

3434

@@ -241,4 +241,4 @@ fn main() {
241241
ip.display();
242242
}
243243
}
244-
```
244+
```

0 commit comments

Comments
 (0)