rust/tests/target/issue-1681.rs

22 lines
669 B
Rust
Raw Normal View History

2017-06-15 09:29:46 -05:00
// rustfmt-max_width: 80
2017-06-15 18:28:12 -05:00
// We would like to surround closure body with block when overflowing the last
// argument of function call if the last argument has condition and without
// block it may go multi lines.
2017-06-15 09:29:46 -05:00
fn foo() {
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)))
}
}
2018-09-19 09:19:24 -05:00
})
.map(MaybeCached::Cached)
2017-06-15 09:29:46 -05:00
}