Skip to content

Commit dcc64d1

Browse files
committed
Rollup merge of rust-lang#26974 - tshepang:trailing-comma, r=Gankro
2 parents bcc0b8c + 6559159 commit dcc64d1

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/libcore/option.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
//! // The division was valid
4747
//! Some(x) => println!("Result: {}", x),
4848
//! // The division was invalid
49-
//! None => println!("Cannot divide by 0")
49+
//! None => println!("Cannot divide by 0"),
5050
//! }
5151
//! ```
5252
//!
@@ -75,7 +75,7 @@
7575
//! fn check_optional(optional: &Option<Box<i32>>) {
7676
//! match *optional {
7777
//! Some(ref p) => println!("have value {}", p),
78-
//! None => println!("have no value")
78+
//! None => println!("have no value"),
7979
//! }
8080
//! }
8181
//! ```
@@ -95,13 +95,13 @@
9595
//! // Take a reference to the contained string
9696
//! match msg {
9797
//! Some(ref m) => println!("{}", *m),
98-
//! None => ()
98+
//! None => (),
9999
//! }
100100
//!
101101
//! // Remove the contained string, destroying the Option
102102
//! let unwrapped_msg = match msg {
103103
//! Some(m) => m,
104-
//! None => "default message"
104+
//! None => "default message",
105105
//! };
106106
//! ```
107107
//!
@@ -137,7 +137,7 @@
137137
//!
138138
//! match name_of_biggest_animal {
139139
//! Some(name) => println!("the biggest animal is {}", name),
140-
//! None => println!("there are no animals :(")
140+
//! None => println!("there are no animals :("),
141141
//! }
142142
//! ```
143143
@@ -198,7 +198,7 @@ impl<T> Option<T> {
198198
pub fn is_some(&self) -> bool {
199199
match *self {
200200
Some(_) => true,
201-
None => false
201+
None => false,
202202
}
203203
}
204204

@@ -244,7 +244,7 @@ impl<T> Option<T> {
244244
pub fn as_ref<'r>(&'r self) -> Option<&'r T> {
245245
match *self {
246246
Some(ref x) => Some(x),
247-
None => None
247+
None => None,
248248
}
249249
}
250250

@@ -265,7 +265,7 @@ impl<T> Option<T> {
265265
pub fn as_mut<'r>(&'r mut self) -> Option<&'r mut T> {
266266
match *self {
267267
Some(ref mut x) => Some(x),
268-
None => None
268+
None => None,
269269
}
270270
}
271271

@@ -376,7 +376,7 @@ impl<T> Option<T> {
376376
pub fn unwrap_or(self, def: T) -> T {
377377
match self {
378378
Some(x) => x,
379-
None => def
379+
None => def,
380380
}
381381
}
382382

@@ -394,7 +394,7 @@ impl<T> Option<T> {
394394
pub fn unwrap_or_else<F: FnOnce() -> T>(self, f: F) -> T {
395395
match self {
396396
Some(x) => x,
397-
None => f()
397+
None => f(),
398398
}
399399
}
400400

@@ -420,7 +420,7 @@ impl<T> Option<T> {
420420
pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Option<U> {
421421
match self {
422422
Some(x) => Some(f(x)),
423-
None => None
423+
None => None,
424424
}
425425
}
426426

@@ -464,7 +464,7 @@ impl<T> Option<T> {
464464
pub fn map_or_else<U, D: FnOnce() -> U, F: FnOnce(T) -> U>(self, default: D, f: F) -> U {
465465
match self {
466466
Some(t) => f(t),
467-
None => default()
467+
None => default(),
468468
}
469469
}
470470

@@ -637,7 +637,7 @@ impl<T> Option<T> {
637637
pub fn or(self, optb: Option<T>) -> Option<T> {
638638
match self {
639639
Some(_) => self,
640-
None => optb
640+
None => optb,
641641
}
642642
}
643643

@@ -659,7 +659,7 @@ impl<T> Option<T> {
659659
pub fn or_else<F: FnOnce() -> Option<T>>(self, f: F) -> Option<T> {
660660
match self {
661661
Some(_) => self,
662-
None => f()
662+
None => f(),
663663
}
664664
}
665665

@@ -736,7 +736,7 @@ impl<T: Default> Option<T> {
736736
pub fn unwrap_or_default(self) -> T {
737737
match self {
738738
Some(x) => x,
739-
None => Default::default()
739+
None => Default::default(),
740740
}
741741
}
742742
}

0 commit comments

Comments
 (0)