rust/tests/target/issue-1681.rs
2017-06-16 07:36:31 +09:00

20 lines
566 B
Rust

// rustfmt-max_width: 80
fn foo() {
// This is where it gets good
refmut_map_result(self.cache.borrow_mut(), |cache| {
match cache.entry(cache_key) {
Occupied(entry) => Ok(entry.into_mut()),
Vacant(entry) => {
let statement = {
let sql = try!(entry.key().sql(source));
prepare_fn(&sql)
};
Ok(entry.insert(try!(statement)))
}
// and now, casually call a method on this
}
}).map(MaybeCached::Cached)
}