]> git.lizzy.rs Git - rust.git/blobdiff - src/string.rs
Change `print_diff` to output the correct line number.
[rust.git] / src / string.rs
index 387bee3cec905bdf475b20764d20a5119736cc61..fd7ac89013a32cba04c94a37bd7cbd2a1bc0df62 100644 (file)
@@ -51,7 +51,7 @@ fn max_chars_with_indent(&self) -> Option<usize> {
             self.shape
                 .width
                 .checked_sub(self.opener.len() + self.line_end.len() + 1)?
-                + 1;
+                + 1,
         )
     }
 
@@ -63,11 +63,7 @@ fn max_chars_without_indent(&self) -> Option<usize> {
     }
 }
 
-pub fn rewrite_string<'a>(
-    orig: &str,
-    fmt: &StringFormat<'a>,
-    max_width: Option<usize>,
-) -> Option<String> {
+pub fn rewrite_string<'a>(orig: &str, fmt: &StringFormat<'a>) -> Option<String> {
     let max_chars_with_indent = fmt.max_chars_with_indent()?;
     let max_chars_without_indent = fmt.max_chars_without_indent()?;
     let indent = fmt.shape.indent.to_string_with_newline(fmt.config);
@@ -235,7 +231,7 @@ mod test {
     fn issue343() {
         let config = Default::default();
         let fmt = StringFormat::new(Shape::legacy(2, Indent::empty()), &config);
-        rewrite_string("eq_", &fmt, None);
+        rewrite_string("eq_", &fmt);
     }
 
     #[test]