@@ -119,13 +119,13 @@ impl<T> Option<T> {
119
119
}
120
120
}
121
121
122
- /// Returns true if the option equals `none `
122
+ /// Returns true if the option equals `None `
123
123
#[ inline]
124
124
pub fn is_none ( & self ) -> bool {
125
125
match * self { None => true , Some ( _) => false }
126
126
}
127
127
128
- /// Returns true if the option contains some value
128
+ /// Returns true if the option contains a `Some` value
129
129
#[ inline]
130
130
pub fn is_some ( & self ) -> bool { !self . is_none ( ) }
131
131
@@ -168,19 +168,19 @@ impl<T> Option<T> {
168
168
}
169
169
}
170
170
171
- /// Maps a `some ` value from one type to another by reference
171
+ /// Maps a `Some ` value from one type to another by reference
172
172
#[ inline]
173
173
pub fn map < ' a , U > ( & ' a self , f : & fn ( & ' a T ) -> U ) -> Option < U > {
174
174
match * self { Some ( ref x) => Some ( f ( x) ) , None => None }
175
175
}
176
176
177
- /// Maps a `some ` value from one type to another by a mutable reference
177
+ /// Maps a `Some ` value from one type to another by a mutable reference
178
178
#[ inline]
179
179
pub fn map_mut < ' a , U > ( & ' a mut self , f : & fn ( & ' a mut T ) -> U ) -> Option < U > {
180
180
match * self { Some ( ref mut x) => Some ( f ( x) ) , None => None }
181
181
}
182
182
183
- /// Maps a `some ` value from one type to another by a mutable reference,
183
+ /// Maps a `Some ` value from one type to another by a mutable reference,
184
184
/// or returns a default value.
185
185
#[ inline]
186
186
pub fn map_mut_default < ' a , U > ( & ' a mut self , def : U , f : & fn ( & ' a mut T ) -> U ) -> U {
@@ -261,7 +261,7 @@ impl<T> Option<T> {
261
261
pub fn get_ref < ' a > ( & ' a self ) -> & ' a T {
262
262
match * self {
263
263
Some ( ref x) => x,
264
- None => fail ! ( "option::get_ref none " )
264
+ None => fail ! ( "option::get_ref None " )
265
265
}
266
266
}
267
267
@@ -283,7 +283,7 @@ impl<T> Option<T> {
283
283
pub fn get_mut_ref < ' a > ( & ' a mut self ) -> & ' a mut T {
284
284
match * self {
285
285
Some ( ref mut x) => x,
286
- None => fail ! ( "option::get_mut_ref none " )
286
+ None => fail ! ( "option::get_mut_ref None " )
287
287
}
288
288
}
289
289
@@ -307,7 +307,7 @@ impl<T> Option<T> {
307
307
*/
308
308
match self {
309
309
Some ( x) => x,
310
- None => fail ! ( "option::unwrap none " )
310
+ None => fail ! ( "option::unwrap None " )
311
311
}
312
312
}
313
313
@@ -321,7 +321,7 @@ impl<T> Option<T> {
321
321
*/
322
322
#[ inline]
323
323
pub fn take_unwrap ( & mut self ) -> T {
324
- if self . is_none ( ) { fail ! ( "option::take_unwrap none " ) }
324
+ if self . is_none ( ) { fail ! ( "option::take_unwrap None " ) }
325
325
self . take ( ) . unwrap ( )
326
326
}
327
327
@@ -331,7 +331,7 @@ impl<T> Option<T> {
331
331
*
332
332
* # Failure
333
333
*
334
- * Fails if the value equals `none `
334
+ * Fails if the value equals `None `
335
335
*/
336
336
#[ inline]
337
337
pub fn expect ( self , reason : & str ) -> T {
@@ -359,7 +359,7 @@ impl<T> Option<T> {
359
359
pub fn get ( self ) -> T {
360
360
match self {
361
361
Some ( x) => return x,
362
- None => fail ! ( "option::get none " )
362
+ None => fail ! ( "option::get None " )
363
363
}
364
364
}
365
365
@@ -369,7 +369,7 @@ impl<T> Option<T> {
369
369
match self { Some ( x) => x, None => def }
370
370
}
371
371
372
- /// Applies a function zero or more times until the result is none .
372
+ /// Applies a function zero or more times until the result is None .
373
373
#[ inline]
374
374
pub fn while_some ( self , blk : & fn ( v : T ) -> Option < T > ) {
375
375
let mut opt = self ;
0 commit comments