diff options
| author | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-04-11 09:24:46 -0700 |
|---|---|---|
| committer | Tim Chevalier <chevalier@alum.wellesley.edu> | 2012-04-23 20:52:50 -0700 |
| commit | 1c39fda0eaeb2f0e7bf37f0cac3541fb0cbc285f (patch) | |
| tree | 200e2ae35f7258b6e96e6074d927c4bc80a812d5 /src/libcore | |
| parent | 9280d0c090ab62a1800c0e423b1da95b1e7db7ec (diff) | |
| download | rust-1c39fda0eaeb2f0e7bf37f0cac3541fb0cbc285f.tar.gz rust-1c39fda0eaeb2f0e7bf37f0cac3541fb0cbc285f.zip | |
Rename option::get_or_default to get_default, for consistency
Diffstat (limited to 'src/libcore')
| -rw-r--r-- | src/libcore/option.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libcore/option.rs b/src/libcore/option.rs index eff29d1e55b..db0d0030f83 100644 --- a/src/libcore/option.rs +++ b/src/libcore/option.rs @@ -52,7 +52,7 @@ pure fn is_some<T>(opt: option<T>) -> bool { !is_none(opt) } -pure fn get_or_default<T: copy>(opt: option<T>, def: T) -> T { +pure fn get_default<T: copy>(opt: option<T>, def: T) -> T { #[doc = "Returns the contained value or a default"]; alt opt { some(x) { x } none { def } } @@ -94,7 +94,7 @@ impl extensions<T:copy> for option<T> { "] fn chain<U>(f: fn(T) -> option<U>) -> option<U> { chain(self, f) } #[doc = "Returns the contained value or a default"] - fn get_or_default(def: T) -> T { get_or_default(self, def) } + fn get_default(def: T) -> T { get_default(self, def) } #[doc = "Applies a function to the contained value or returns a default"] fn map_default<U: copy>(def: U, f: fn(T) -> U) -> U { map_default(self, def, f) } |
