From 4a73c8eac7660735822f7d43ac8be2b40b2e1d93 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Mon, 9 Sep 2013 19:29:11 -0700 Subject: std: add default implementations to Option --- src/libstd/option.rs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/libstd') diff --git a/src/libstd/option.rs b/src/libstd/option.rs index 5ac6fcda043..1f3a31a403c 100644 --- a/src/libstd/option.rs +++ b/src/libstd/option.rs @@ -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 Option { } } +impl Default for Option { + fn default() -> Option { None } +} + impl Option { /// Returns the contained value or zero (for this type) #[inline] -- cgit 1.4.1-3-g733a5