File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
branches/snap-stage3/src/libcore Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
refs/heads/master: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
- refs/heads/snap-stage3: a33966b2f2a93b5108d0fd4464b18912da270e15
4
+ refs/heads/snap-stage3: 65a0125f7f2e016a066bb3e8944b6ec31d2d46c7
5
5
refs/heads/try: d324a424d8f84b1eb049b12cf34182bda91b0024
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
Original file line number Diff line number Diff line change @@ -277,6 +277,13 @@ impl<T> Option<T> {
277
277
map_default ( self , move def, f)
278
278
}
279
279
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
+
280
287
/// Performs an operation on the contained value by reference
281
288
#[ inline( always) ]
282
289
pure fn iter ( & self , f : fn ( x : & T ) ) { iter ( self , f) }
You can’t perform that action at this time.
0 commit comments