Skip to content

Commit ca46deb

Browse files
committed
---
yaml --- r: 34542 b: refs/heads/snap-stage3 c: 65a0125 h: refs/heads/master v: v3
1 parent 66d16b0 commit ca46deb

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
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: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: a33966b2f2a93b5108d0fd4464b18912da270e15
4+
refs/heads/snap-stage3: 65a0125f7f2e016a066bb3e8944b6ec31d2d46c7
55
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libcore/option.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,13 @@ impl<T> Option<T> {
277277
map_default(self, move def, f)
278278
}
279279

280+
/// As `map_default`, but consumes the option and gives `f`
281+
/// ownership to avoid copying.
282+
#[inline(always)]
283+
pure fn map_consume_default<U>(self, def: U, f: fn(v: T) -> U) -> U {
284+
match self { None => def, Some(v) => f(v) }
285+
}
286+
280287
/// Performs an operation on the contained value by reference
281288
#[inline(always)]
282289
pure fn iter(&self, f: fn(x: &T)) { iter(self, f) }

0 commit comments

Comments
 (0)