Skip to content

Commit 0e23b2e

Browse files
committed
---
yaml --- r: 113657 b: refs/heads/snap-stage3 c: 2446827 h: refs/heads/master i: 113655: 3d70b53 v: v3
1 parent cca4365 commit 0e23b2e

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: abdacecdf86b4b5a4f432560445a24e1c5f4751b
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 44fcf46b00389bea30f4902ce77f2e33557d9170
4+
refs/heads/snap-stage3: 24468278fd0b6c09d3b105dd2dfc56e7066b961b
55
refs/heads/try: 7c6c492fb2af9a85f21ff952942df3523b22fd17
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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/snap-stage3/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)