diff --git a/src/ast.rs b/src/ast.rs index dc90b75..f167bae 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -48,7 +48,7 @@ impl ToTokens for Func { } fn parse_signature(input: &mut TokenIter) -> Vec { - let mut sig = Vec::new(); + let mut sig = vec![]; let mut has_const = false; loop { match input.peek() { @@ -82,7 +82,7 @@ fn parse_signature(input: &mut TokenIter) -> Vec { } fn parse_attrs(input: &mut TokenIter) -> Result> { - let mut attrs = Vec::new(); + let mut attrs = vec![]; loop { let pound_token = match input.peek() { Some(TokenTree::Punct(p)) if p.as_char() == '#' => input.next().unwrap(), diff --git a/test_suite/tests/test.rs b/test_suite/tests/test.rs index e04c0d1..85946fc 100644 --- a/test_suite/tests/test.rs +++ b/test_suite/tests/test.rs @@ -174,9 +174,9 @@ pub mod version { fn test() { assert!(const_min("variables") == "variables"); assert_eq!(const_let("variables"), "variables"); - assert_eq!(const_vec_new::(), Vec::new()); + assert_eq!(const_vec_new::(), vec![]); assert_eq!(const_match(1), Some(1)); - assert_eq!(A::const_fn_trait_bound(const_vec_new::()), A(Vec::new())); + assert_eq!(A::const_fn_trait_bound(const_vec_new::()), A(vec![])); } } @@ -241,9 +241,9 @@ pub mod cfg { fn test() { assert!(const_min("variables") == "variables"); assert_eq!(const_let("variables"), "variables"); - assert_eq!(const_vec_new::(), Vec::new()); + assert_eq!(const_vec_new::(), vec![]); assert_eq!(const_match(1), Some(1)); - assert_eq!(A::const_fn_trait_bound(const_vec_new::()), A(Vec::new())); + assert_eq!(A::const_fn_trait_bound(const_vec_new::()), A(vec![])); } }