Skip to content

Commit 4291774

Browse files
Use square brackets in vec! macro.
It's the default behavior of `rust-fmt`, and it's consistent with the rest of examples from the book.
1 parent f74f058 commit 4291774

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/std/hash/hashset.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ Try all of these in the following example:
3636
use std::collections::HashSet;
3737
3838
fn main() {
39-
let mut a: HashSet<i32> = vec!(1i32, 2, 3).into_iter().collect();
40-
let mut b: HashSet<i32> = vec!(2i32, 3, 4).into_iter().collect();
39+
let mut a: HashSet<i32> = vec![1i32, 2, 3].into_iter().collect();
40+
let mut b: HashSet<i32> = vec![2i32, 3, 4].into_iter().collect();
4141
4242
assert!(a.insert(4));
4343
assert!(a.contains(&4));

0 commit comments

Comments
 (0)