From 0ac7a219f043d3b1c8c239089d9dd6e6c9fa830b Mon Sep 17 00:00:00 2001 From: Marvin Löbel Date: Sun, 4 Aug 2013 01:59:24 +0200 Subject: Updated std::Option, std::Either and std::Result - Made naming schemes consistent between Option, Result and Either - Changed Options Add implementation to work like the maybe monad (return None if any of the inputs is None) - Removed duplicate Option::get and renamed all related functions to use the term `unwrap` instead --- src/libstd/vec.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/libstd/vec.rs') diff --git a/src/libstd/vec.rs b/src/libstd/vec.rs index f037aa2b7e7..4d4437cc963 100644 --- a/src/libstd/vec.rs +++ b/src/libstd/vec.rs @@ -195,10 +195,8 @@ pub fn build(builder: &fn(push: &fn(v: A))) -> ~[A] { * onto the vector being constructed. */ #[inline] -pub fn build_sized_opt(size: Option, - builder: &fn(push: &fn(v: A))) - -> ~[A] { - build_sized(size.get_or_default(4), builder) +pub fn build_sized_opt(size: Option, builder: &fn(push: &fn(v: A))) -> ~[A] { + build_sized(size.unwrap_or_default(4), builder) } /// An iterator over the slices of a vector separated by elements that -- cgit 1.4.1-3-g733a5