about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libcore/at_vec.rs2
-rw-r--r--src/libcore/iter.rs2
-rw-r--r--src/libcore/option.rs14
-rw-r--r--src/libcore/os.rs4
-rw-r--r--src/libcore/vec.rs2
-rw-r--r--src/librustc/metadata/filesearch.rs6
-rw-r--r--src/librustc/middle/trans/alt.rs2
-rw-r--r--src/librustc/middle/trans/monomorphize.rs2
-rw-r--r--src/librustdoc/attr_pass.rs2
-rw-r--r--src/librustdoc/config.rs2
-rw-r--r--src/libsyntax/parse/comments.rs2
11 files changed, 20 insertions, 20 deletions
diff --git a/src/libcore/at_vec.rs b/src/libcore/at_vec.rs
index 0aa4fd68d57..4f3f63c83fc 100644
--- a/src/libcore/at_vec.rs
+++ b/src/libcore/at_vec.rs
@@ -100,7 +100,7 @@ pub pure fn build<A>(builder: &fn(push: pure fn(v: A))) -> @[A] {
 #[inline(always)]
 pub pure fn build_sized_opt<A>(size: Option<uint>,
                                builder: &fn(push: pure fn(v: A))) -> @[A] {
-    build_sized(size.get_default(4), builder)
+    build_sized(size.get_or_default(4), builder)
 }
 
 // Appending
diff --git a/src/libcore/iter.rs b/src/libcore/iter.rs
index aa966070980..db82fa14950 100644
--- a/src/libcore/iter.rs
+++ b/src/libcore/iter.rs
@@ -267,7 +267,7 @@ pub pure fn build_sized_opt<A,B: Buildable<A>>(
     size: Option<uint>,
     builder: fn(push: pure fn(A))) -> B {
 
-    Buildable::build_sized(size.get_default(4), builder)
+    Buildable::build_sized(size.get_or_default(4), builder)
 }
 
 // Functions that combine iteration and building
diff --git a/src/libcore/option.rs b/src/libcore/option.rs
index 5b5b3b271ff..a46736055a0 100644
--- a/src/libcore/option.rs
+++ b/src/libcore/option.rs
@@ -171,13 +171,13 @@ pub pure fn is_some<T>(opt: &Option<T>) -> bool {
     !is_none(opt)
 }
 
-pub pure fn get_zero<T: Copy Zero>(opt: Option<T>) -> T {
+pub pure fn get_or_zero<T: Copy Zero>(opt: Option<T>) -> T {
     //! Returns the contained value or zero (for this type)
 
     match opt { Some(copy x) => x, None => Zero::zero() }
 }
 
-pub pure fn get_default<T: Copy>(opt: Option<T>, def: T) -> T {
+pub pure fn get_or_default<T: Copy>(opt: Option<T>, def: T) -> T {
     //! Returns the contained value or a default
 
     match opt { Some(copy x) => x, None => def }
@@ -331,7 +331,7 @@ impl<T: Copy> Option<T> {
     pure fn get(self) -> T { get(self) }
 
     #[inline(always)]
-    pure fn get_default(self, def: T) -> T { get_default(self, def) }
+    pure fn get_or_default(self, def: T) -> T { get_or_default(self, def) }
 
     /// Applies a function zero or more times until the result is none.
     #[inline(always)]
@@ -342,7 +342,7 @@ impl<T: Copy> Option<T> {
 
 impl<T: Copy Zero> Option<T> {
     #[inline(always)]
-    pure fn get_zero(self) -> T { get_zero(self) }
+    pure fn get_or_zero(self) -> T { get_or_zero(self) }
 }
 
 #[test]
@@ -420,11 +420,11 @@ fn test_option_while_some() {
 }
 
 #[test]
-fn test_get_zero() {
+fn test_get_or_zero() {
     let some_stuff = Some(42);
-    assert some_stuff.get_zero() == 42;
+    assert some_stuff.get_or_zero() == 42;
     let no_stuff: Option<int> = None;
-    assert no_stuff.get_zero() == 0;
+    assert no_stuff.get_or_zero() == 0;
 }
 
 // Local Variables:
diff --git a/src/libcore/os.rs b/src/libcore/os.rs
index c8311722ee4..2d9f95df749 100644
--- a/src/libcore/os.rs
+++ b/src/libcore/os.rs
@@ -510,14 +510,14 @@ pub fn tmpdir() -> Path {
     #[cfg(unix)]
     #[allow(non_implicitly_copyable_typarams)]
     fn lookup() -> Path {
-        option::get_default(getenv_nonempty("TMPDIR"),
+        option::get_or_default(getenv_nonempty("TMPDIR"),
                             Path("/tmp"))
     }
 
     #[cfg(windows)]
     #[allow(non_implicitly_copyable_typarams)]
     fn lookup() -> Path {
-        option::get_default(
+        option::get_or_default(
                     option::or(getenv_nonempty("TMP"),
                     option::or(getenv_nonempty("TEMP"),
                     option::or(getenv_nonempty("USERPROFILE"),
diff --git a/src/libcore/vec.rs b/src/libcore/vec.rs
index 17181e62005..cdd8db6c543 100644
--- a/src/libcore/vec.rs
+++ b/src/libcore/vec.rs
@@ -203,7 +203,7 @@ pub pure fn build<A>(builder: fn(push: pure fn(v: A))) -> ~[A] {
 #[inline(always)]
 pub pure fn build_sized_opt<A>(size: Option<uint>,
                            builder: fn(push: pure fn(v: A))) -> ~[A] {
-    build_sized(size.get_default(4), builder)
+    build_sized(size.get_or_default(4), builder)
 }
 
 /// Produces a mut vector from an immutable vector.
diff --git a/src/librustc/metadata/filesearch.rs b/src/librustc/metadata/filesearch.rs
index a9f8a485c5c..849d56958c3 100644
--- a/src/librustc/metadata/filesearch.rs
+++ b/src/librustc/metadata/filesearch.rs
@@ -113,7 +113,7 @@ fn make_target_lib_path(sysroot: &Path,
     sysroot.push_rel(&relative_target_lib_path(target_triple))
 }
 
-fn get_default_sysroot() -> Path {
+fn get_or_default_sysroot() -> Path {
     match os::self_exe_path() {
       option::Some(ref p) => (*p).pop(),
       option::None => fail ~"can't determine value for sysroot"
@@ -123,12 +123,12 @@ fn get_default_sysroot() -> Path {
 fn get_sysroot(maybe_sysroot: Option<Path>) -> Path {
     match maybe_sysroot {
       option::Some(ref sr) => (*sr),
-      option::None => get_default_sysroot()
+      option::None => get_or_default_sysroot()
     }
 }
 
 fn get_cargo_sysroot() -> Result<Path, ~str> {
-    result::Ok(get_default_sysroot().push_many([libdir(), ~"cargo"]))
+    result::Ok(get_or_default_sysroot().push_many([libdir(), ~"cargo"]))
 }
 
 fn get_cargo_root() -> Result<Path, ~str> {
diff --git a/src/librustc/middle/trans/alt.rs b/src/librustc/middle/trans/alt.rs
index 7880babbd12..21493f8d820 100644
--- a/src/librustc/middle/trans/alt.rs
+++ b/src/librustc/middle/trans/alt.rs
@@ -502,7 +502,7 @@ fn enter_opt(bcx: block, m: &[@Match/&r], opt: &Opt, col: uint,
         match p.node {
             ast::pat_enum(_, subpats) => {
                 if opt_eq(tcx, &variant_opt(tcx, p.id), opt) {
-                    Some(option::get_default(subpats,
+                    Some(option::get_or_default(subpats,
                                              vec::from_elem(variant_size,
                                                             dummy)))
                 } else {
diff --git a/src/librustc/middle/trans/monomorphize.rs b/src/librustc/middle/trans/monomorphize.rs
index f74c4b96e02..285e80ef25e 100644
--- a/src/librustc/middle/trans/monomorphize.rs
+++ b/src/librustc/middle/trans/monomorphize.rs
@@ -136,7 +136,7 @@ fn monomorphic_fn(ccx: @crate_ctxt,
 
     ccx.stats.n_monos += 1;
 
-    let depth = option::get_default(ccx.monomorphizing.find(fn_id), 0u);
+    let depth = option::get_or_default(ccx.monomorphizing.find(fn_id), 0u);
     // Random cut-off -- code that needs to instantiate the same function
     // recursively more than ten times can probably safely be assumed to be
     // causing an infinite expansion.
diff --git a/src/librustdoc/attr_pass.rs b/src/librustdoc/attr_pass.rs
index 812185ec34d..8e52fb25a94 100644
--- a/src/librustdoc/attr_pass.rs
+++ b/src/librustdoc/attr_pass.rs
@@ -69,7 +69,7 @@ fn fold_crate(
     {
         topmod: doc::ModDoc_({
             item: {
-                name: option::get_default(attrs.name, doc.topmod.name()),
+                name: option::get_or_default(attrs.name, doc.topmod.name()),
                 .. doc.topmod.item
             },
             .. *doc.topmod
diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs
index 5bce6c8ffff..94b3a966184 100644
--- a/src/librustdoc/config.rs
+++ b/src/librustdoc/config.rs
@@ -154,7 +154,7 @@ fn config_from_opts(
         let output_dir = getopts::opt_maybe_str(matches, opt_output_dir());
         let output_dir = output_dir.map(|s| Path(*s));
         result::Ok({
-            output_dir: output_dir.get_default(config.output_dir),
+            output_dir: output_dir.get_or_default(config.output_dir),
             .. config
         })
     };
diff --git a/src/libsyntax/parse/comments.rs b/src/libsyntax/parse/comments.rs
index 0cd3ef0ee73..d5365d59041 100644
--- a/src/libsyntax/parse/comments.rs
+++ b/src/libsyntax/parse/comments.rs
@@ -83,7 +83,7 @@ fn strip_doc_comment_decoration(comment: ~str) -> ~str {
     // drop leftmost columns that contain only values in chars
     fn block_trim(lines: ~[~str], chars: ~str, max: Option<uint>) -> ~[~str] {
 
-        let mut i = max.get_default(uint::max_value);
+        let mut i = max.get_or_default(uint::max_value);
         for lines.each |line| {
             if line.trim().is_empty() {
                 loop;