Closed
Description
I'd like to write the following code with map
:
fn foobar(map: Option<&BTreeMap<u32,u32>>) {
let temp;
let map = match map {
Some(a) => a,
None => { temp = BTreeMap::new(); &temp }
}
// Do something.
}
But the following thing doesn't work:
let temp;
map.unwrap_or_else(|| { temp = BTreeMap::new(); &temp })