Skip to content

Commit 7061c6a

Browse files
committed
---
yaml --- r: 151837 b: refs/heads/try2 c: 2446827 h: refs/heads/master i: 151835: ba0d441 v: v3
1 parent 2f5eb03 commit 7061c6a

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 44fcf46b00389bea30f4902ce77f2e33557d9170
8+
refs/heads/try2: 24468278fd0b6c09d3b105dd2dfc56e7066b961b
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libcore/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//!
1818
//! * `memcpy`, `memcmp`, `memset` - These are core memory routines which are
1919
//! often generated by LLVM. Additionally, this library can make explicit
20-
//! calls to these functions. Their signatures are the same as found in C.
20+
//! calls to these funcitons. Their signatures are the same as found in C.
2121
//! These functions are often provided by the system libc, but can also be
2222
//! provided by `librlibc` which is distributed with the standard rust
2323
//! distribution.

branches/try2/src/libcore/result.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -508,12 +508,19 @@ impl<T, E> Result<T, E> {
508508
/// Unwraps a result, yielding the content of an `Ok`.
509509
/// If the value is an `Err` then it calls `op` with its value.
510510
#[inline]
511-
pub fn unwrap_or_handle(self, op: |E| -> T) -> T {
511+
pub fn unwrap_or_else(self, op: |E| -> T) -> T {
512512
match self {
513513
Ok(t) => t,
514514
Err(e) => op(e)
515515
}
516516
}
517+
518+
/// Deprecated name for `unwrap_or_else()`.
519+
#[deprecated = "replaced by .unwrap_or_else()"]
520+
#[inline]
521+
pub fn unwrap_or_handle(self, op: |E| -> T) -> T {
522+
self.unwrap_or_else(op)
523+
}
517524
}
518525

519526
impl<T, E: Show> Result<T, E> {
@@ -758,8 +765,8 @@ mod tests {
758765
let ok: Result<int, ~str> = Ok(100);
759766
let ok_err: Result<int, ~str> = Err("I got this.".to_owned());
760767

761-
assert_eq!(ok.unwrap_or_handle(handler), 100);
762-
assert_eq!(ok_err.unwrap_or_handle(handler), 50);
768+
assert_eq!(ok.unwrap_or_else(handler), 100);
769+
assert_eq!(ok_err.unwrap_or_else(handler), 50);
763770
}
764771

765772
#[test]
@@ -774,6 +781,6 @@ mod tests {
774781
}
775782

776783
let bad_err: Result<int, ~str> = Err("Unrecoverable mess.".to_owned());
777-
let _ : int = bad_err.unwrap_or_handle(handler);
784+
let _ : int = bad_err.unwrap_or_else(handler);
778785
}
779786
}

0 commit comments

Comments
 (0)