From c1fc693c5e5676f93a331a0498dc6ba36193cd66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Cassiers?= Date: Sun, 24 May 2015 23:35:40 +0200 Subject: [PATCH] syle correction --- src/expr.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/expr.rs b/src/expr.rs index 66a79a3a777..c242322a51d 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -132,11 +132,14 @@ impl<'a> FmtVisitor<'a> { debug!("rewrite_paren, subexpr_str: `{}`", subexpr_str); let mut lines = subexpr_str.rsplit('\n'); let last_line_len = lines.next().unwrap().len(); - let last_line_offset = if lines.next().is_none() {offset+1} else {0}; + let last_line_offset = match lines.next() { + None => offset+1, + Some(_) => 0, + }; if width + offset - last_line_offset - last_line_len > 0 { format!("({})", subexpr_str) } else { - // FIXME That's correct unless we have width < 2. Return an Optrion for such cases ? + // FIXME That's correct unless we have width < 2. Return an Option for such cases ? format!("({}\n{} )", subexpr_str, make_indent(offset)) } }