]> git.lizzy.rs Git - rust.git/blobdiff - src/overflow.rs
Change `print_diff` to output the correct line number.
[rust.git] / src / overflow.rs
index 1a223cf3ca636f76e0d27c493f0a218001f38611..674eb14b677b3435faa03a77f49c3860d066480f 100644 (file)
@@ -223,7 +223,7 @@ fn try_overflow_last_item(&self, list_items: &mut Vec<ListItem>) -> DefinitiveLi
         // 1 = "("
         let combine_arg_with_callee = self.items.len() == 1
             && self.items[0].to_expr().is_some()
-            && self.ident.len() + 1 <= self.context.config.tab_spaces();
+            && self.ident.len() < self.context.config.tab_spaces();
         let overflow_last = combine_arg_with_callee || can_be_overflowed(self.context, self.items);
 
         // Replace the last item with its first line to see if it fits with
@@ -291,7 +291,7 @@ fn try_overflow_last_item(&self, list_items: &mut Vec<ListItem>) -> DefinitiveLi
             (true, DefinitiveListTactic::Horizontal, placeholder @ Some(..)) => {
                 list_items[self.items.len() - 1].item = placeholder;
             }
-            _ if self.items.len() >= 1 => {
+            _ if !self.items.is_empty() => {
                 list_items[self.items.len() - 1].item = self
                     .items
                     .last()