]> git.lizzy.rs Git - rust.git/commit
chains: prefer to use the next line for an expression, if using the same line would...
authorNick Cameron <ncameron@mozilla.com>
Wed, 11 Jul 2018 09:01:40 +0000 (21:01 +1200)
committerNick Cameron <ncameron@mozilla.com>
Tue, 24 Jul 2018 03:43:29 +0000 (15:43 +1200)
commitf0fe9c3c4acb4eafba5a552a2823e6997e75a3f4
treef28efab727642d68955b9286b9fac80efd76f4fd
parent5bc27593f44a7c2108ca1a69eba2d34b3db90935
chains: prefer to use the next line for an expression, if using the same line would introduce an open block or similar

This problem came to light due to the chains changes, but effects other code too. It only happens rarely, e.g.,

before this fix:
```
    match foo {
        MacroArgKind::Delimited(ref delim_tok, ref args) => rewrite_delimited_inner(
            delim_tok,
            args,
        ).map(|(lhs, inner, rhs)| format!("{}{}{}", lhs, inner, rhs)),
    };

```

after:
```
    match foo {
        MacroArgKind::Delimited(ref delim_tok, ref args) => {
            rewrite_delimited_inner(delim_tok, args)
                .map(|(lhs, inner, rhs)| format!("{}{}{}", lhs, inner, rhs))
        }
    }

```
src/chains.rs
src/expr.rs
src/utils.rs