From e7d26a491724f347059a2f89cc4da676b6d2c970 Mon Sep 17 00:00:00 2001 From: Ben Blum Date: Tue, 31 Jul 2012 13:21:15 -0400 Subject: make option::map_default instead of U:copy --- src/libcore/option.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/libcore/option.rs b/src/libcore/option.rs index 270ba90c704..074dd086926 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -88,7 +88,7 @@ pure fn get_default(opt: option, def: T) -> T { alt opt { some(x) { x } none { def } } } -pure fn map_default(opt: option, def: U, f: fn(T) -> U) -> U { +pure fn map_default(opt: option, +def: U, f: fn(T) -> U) -> U { //! Applies a function to the contained value or returns a default alt opt { none { def } some(t) { f(t) } } @@ -133,7 +133,7 @@ impl extensions for option { */ pure fn chain(f: fn(T) -> option) -> option { chain(self, f) } /// Applies a function to the contained value or returns a default - pure fn map_default(def: U, f: fn(T) -> U) -> U + pure fn map_default(+def: U, f: fn(T) -> U) -> U { map_default(self, def, f) } /// Performs an operation on the contained value or does nothing pure fn iter(f: fn(T)) { iter(self, f) } -- cgit 1.4.1-3-g733a5