Skip to content

Commit c1fc693

Browse files
committed
syle correction
1 parent 1db6fa0 commit c1fc693

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/expr.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,14 @@ impl<'a> FmtVisitor<'a> {
132132
debug!("rewrite_paren, subexpr_str: `{}`", subexpr_str);
133133
let mut lines = subexpr_str.rsplit('\n');
134134
let last_line_len = lines.next().unwrap().len();
135-
let last_line_offset = if lines.next().is_none() {offset+1} else {0};
135+
let last_line_offset = match lines.next() {
136+
None => offset+1,
137+
Some(_) => 0,
138+
};
136139
if width + offset - last_line_offset - last_line_len > 0 {
137140
format!("({})", subexpr_str)
138141
} else {
139-
// FIXME That's correct unless we have width < 2. Return an Optrion for such cases ?
142+
// FIXME That's correct unless we have width < 2. Return an Option for such cases ?
140143
format!("({}\n{} )", subexpr_str, make_indent(offset))
141144
}
142145
}

0 commit comments

Comments
 (0)