Open
Description
Rust Nightly 1.22.0
use std::collections::BTreeMap;
fn foo(_qux: &BTreeMap<&'static str, &'static str>) -> Option<String> {
Some("baz".to_owned())
}
fn main() {
let mut map = BTreeMap::new();
map.insert("foo", "bar");
foo(&map).and_then( |baz| {
let mut map = map;
map.insert("sign", &baz);
Some(())
});
}
如果注释掉 let mut map = map;
,为什么会报错?