mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
std: add default implementations to Option
This commit is contained in:
parent
653400a7f0
commit
4a73c8eac7
@ -43,6 +43,7 @@ let unwrapped_msg = match msg {
|
||||
|
||||
use clone::Clone;
|
||||
use cmp::{Eq,Ord};
|
||||
use default::Default;
|
||||
use util;
|
||||
use num::Zero;
|
||||
use iter;
|
||||
@ -349,6 +350,10 @@ impl<T> Option<T> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Default for Option<T> {
|
||||
fn default() -> Option<T> { None }
|
||||
}
|
||||
|
||||
impl<T:Zero> Option<T> {
|
||||
/// Returns the contained value or zero (for this type)
|
||||
#[inline]
|
||||
|
Loading…
Reference in New Issue
Block a user