diff options
| author | iirelu <anna@bawk.space> | 2016-10-29 22:54:04 +0100 |
|---|---|---|
| committer | iirelu <anna@bawk.space> | 2016-10-31 22:51:40 +0000 |
| commit | e593c3b89343a98bdcc76ce9f5869ff18882dfff (patch) | |
| tree | 86cc097322145fde8ec27dca59fa70787e5cddc3 /src/librustc_const_eval | |
| parent | f26eedb571c8e3f55385f3933be256689deed277 (diff) | |
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.
Diffstat (limited to 'src/librustc_const_eval')
| -rw-r--r-- | src/librustc_const_eval/diagnostics.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_const_eval/diagnostics.rs b/src/librustc_const_eval/diagnostics.rs index 092638cdee2..db72057636a 100644 --- a/src/librustc_const_eval/diagnostics.rs +++ b/src/librustc_const_eval/diagnostics.rs @@ -454,7 +454,7 @@ loop variable, consider using a `match` or `if let` inside the loop body. For instance: ```compile_fail,E0297 -let xs : Vec<Option<i32>> = vec!(Some(1), None); +let xs : Vec<Option<i32>> = vec![Some(1), None]; // This fails because `None` is not covered. for Some(x) in xs { @@ -465,7 +465,7 @@ for Some(x) in xs { Match inside the loop instead: ``` -let xs : Vec<Option<i32>> = vec!(Some(1), None); +let xs : Vec<Option<i32>> = vec![Some(1), None]; for item in xs { match item { @@ -478,7 +478,7 @@ for item in xs { Or use `if let`: ``` -let xs : Vec<Option<i32>> = vec!(Some(1), None); +let xs : Vec<Option<i32>> = vec![Some(1), None]; for item in xs { if let Some(x) = item { |
