]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/issue-1681.rs
Merge commit 'e36a20c24f35a4cee82bbdc600289104c9237c22' into ra-sync-and-pms-component
[rust.git] / src / tools / rustfmt / tests / target / issue-1681.rs
1 // rustfmt-max_width: 80
2
3 // We would like to surround closure body with block when overflowing the last
4 // argument of function call if the last argument has condition and without
5 // block it may go multi lines.
6 fn foo() {
7     refmut_map_result(self.cache.borrow_mut(), |cache| {
8         match cache.entry(cache_key) {
9             Occupied(entry) => Ok(entry.into_mut()),
10             Vacant(entry) => {
11                 let statement = {
12                     let sql = try!(entry.key().sql(source));
13                     prepare_fn(&sql)
14                 };
15
16                 Ok(entry.insert(try!(statement)))
17             }
18         }
19     })
20     .map(MaybeCached::Cached)
21 }