Changed most vec! invocations to use square braces
Most of the Rust community agrees that the vec! macro is clearer when called using square brackets [] instead of regular brackets (). Most of these ocurrences are from before macros allowed using different types of brackets. There is one left unchanged in a pretty-print test, as the pretty printer still wants it to have regular brackets.
This commit is contained in:
parent
f26eedb571
commit
e593c3b893
189 changed files with 511 additions and 511 deletions
|
@ -3880,8 +3880,8 @@ mod tests {
|
|||
use std::collections::{HashMap,BTreeMap};
|
||||
use super::ToJson;
|
||||
|
||||
let array2 = Array(vec!(U64(1), U64(2)));
|
||||
let array3 = Array(vec!(U64(1), U64(2), U64(3)));
|
||||
let array2 = Array(vec![U64(1), U64(2)]);
|
||||
let array3 = Array(vec![U64(1), U64(2), U64(3)]);
|
||||
let object = {
|
||||
let mut tree_map = BTreeMap::new();
|
||||
tree_map.insert("a".to_string(), U64(1));
|
||||
|
@ -3915,7 +3915,7 @@ mod tests {
|
|||
assert_eq!([1_usize, 2_usize].to_json(), array2);
|
||||
assert_eq!((&[1_usize, 2_usize, 3_usize]).to_json(), array3);
|
||||
assert_eq!((vec![1_usize, 2_usize]).to_json(), array2);
|
||||
assert_eq!(vec!(1_usize, 2_usize, 3_usize).to_json(), array3);
|
||||
assert_eq!(vec![1_usize, 2_usize, 3_usize].to_json(), array3);
|
||||
let mut tree_map = BTreeMap::new();
|
||||
tree_map.insert("a".to_string(), 1 as usize);
|
||||
tree_map.insert("b".to_string(), 2);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue