@@ -235,7 +235,10 @@ impl<T> Option<T> {
235
235
#[ inline]
236
236
#[ stable]
237
237
pub fn as_ref < ' r > ( & ' r self ) -> Option < & ' r T > {
238
- match * self { Some ( ref x) => Some ( x) , None => None }
238
+ match * self {
239
+ Some ( ref x) => Some ( x) ,
240
+ None => None
241
+ }
239
242
}
240
243
241
244
/// Convert from `Option<T>` to `Option<&mut T>`
@@ -253,7 +256,10 @@ impl<T> Option<T> {
253
256
#[ inline]
254
257
#[ unstable = "waiting for mut conventions" ]
255
258
pub fn as_mut < ' r > ( & ' r mut self ) -> Option < & ' r mut T > {
256
- match * self { Some ( ref mut x) => Some ( x) , None => None }
259
+ match * self {
260
+ Some ( ref mut x) => Some ( x) ,
261
+ None => None
262
+ }
257
263
}
258
264
259
265
/// Convert from `Option<T>` to `&mut [T]` (without copying)
@@ -401,7 +407,10 @@ impl<T> Option<T> {
401
407
#[ inline]
402
408
#[ unstable = "waiting for unboxed closures" ]
403
409
pub fn map < U > ( self , f: |T | -> U ) -> Option < U > {
404
- match self { Some ( x) => Some ( f ( x) ) , None => None }
410
+ match self {
411
+ Some ( x) => Some ( f ( x) ) ,
412
+ None => None
413
+ }
405
414
}
406
415
407
416
/// Applies a function to the contained value or returns a default.
@@ -418,7 +427,10 @@ impl<T> Option<T> {
418
427
#[ inline]
419
428
#[ unstable = "waiting for unboxed closures" ]
420
429
pub fn map_or < U > ( self , def : U , f: |T | -> U ) -> U {
421
- match self { None => def, Some ( t) => f ( t) }
430
+ match self {
431
+ Some ( t) => f ( t) ,
432
+ None => def
433
+ }
422
434
}
423
435
424
436
/// Applies a function to the contained value or computes a default.
@@ -437,7 +449,10 @@ impl<T> Option<T> {
437
449
#[ inline]
438
450
#[ unstable = "waiting for unboxed closures" ]
439
451
pub fn map_or_else < U > ( self , def: || -> U , f: |T | -> U ) -> U {
440
- match self { None => def ( ) , Some ( t) => f ( t) }
452
+ match self {
453
+ Some ( t) => f ( t) ,
454
+ None => def ( )
455
+ }
441
456
}
442
457
443
458
/// Transforms the `Option<T>` into a `Result<T, E>`, mapping `Some(v)` to
0 commit comments