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/libcore | |
| parent | f26eedb571c8e3f55385f3933be256689deed277 (diff) | |
| download | rust-e593c3b89343a98bdcc76ce9f5869ff18882dfff.tar.gz rust-e593c3b89343a98bdcc76ce9f5869ff18882dfff.zip | |
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/libcore')
| -rw-r--r-- | src/libcore/option.rs | 4 | ||||
| -rw-r--r-- | src/libcore/result.rs | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libcore/option.rs b/src/libcore/option.rs index cb18feff734..a74979911d3 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -914,12 +914,12 @@ impl<A, V: FromIterator<A>> FromIterator<Option<A>> for Option<V> { /// ``` /// use std::u16; /// - /// let v = vec!(1, 2); + /// let v = vec![1, 2]; /// let res: Option<Vec<u16>> = v.iter().map(|&x: &u16| /// if x == u16::MAX { None } /// else { Some(x + 1) } /// ).collect(); - /// assert!(res == Some(vec!(2, 3))); + /// assert!(res == Some(vec![2, 3])); /// ``` #[inline] fn from_iter<I: IntoIterator<Item=Option<A>>>(iter: I) -> Option<V> { diff --git a/src/libcore/result.rs b/src/libcore/result.rs index 78230b60804..9cb42124e00 100644 --- a/src/libcore/result.rs +++ b/src/libcore/result.rs @@ -977,12 +977,12 @@ impl<A, E, V: FromIterator<A>> FromIterator<Result<A, E>> for Result<V, E> { /// ``` /// use std::u32; /// - /// let v = vec!(1, 2); + /// let v = vec![1, 2]; /// let res: Result<Vec<u32>, &'static str> = v.iter().map(|&x: &u32| /// if x == u32::MAX { Err("Overflow!") } /// else { Ok(x + 1) } /// ).collect(); - /// assert!(res == Ok(vec!(2, 3))); + /// assert!(res == Ok(vec![2, 3])); /// ``` #[inline] fn from_iter<I: IntoIterator<Item=Result<A, E>>>(iter: I) -> Result<V, E> { |
