about summary refs log tree commit diff
path: root/src/string.rs
diff options
context:
space:
mode:
authorCaleb Cartwright <caleb.cartwright@outlook.com>2021-07-25 22:57:19 -0500
committerCaleb Cartwright <caleb.cartwright@outlook.com>2021-07-25 22:57:19 -0500
commite4b8714c0986def4ac895f6e6df0c913f924dbb8 (patch)
treebea66f1fa5b10e6381f2426a40f5ea50ce032388 /src/string.rs
parent277feac1f97324dffea0bfc3816ef8d3f73026f3 (diff)
Merge commit '4236289b75ee55c78538c749512cdbeea5e1c332' into update-rustfmt
Diffstat (limited to 'src/string.rs')
-rw-r--r--src/string.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/string.rs b/src/string.rs
index 080c4f17788..0cb9d817ca2 100644
--- a/src/string.rs
+++ b/src/string.rs
@@ -57,7 +57,7 @@ impl<'a> StringFormat<'a> {
     /// This allows to fit more graphemes from the string on a line when
     /// SnippetState::EndWithLineFeed.
     fn max_width_without_indent(&self) -> Option<usize> {
-        Some(self.config.max_width().checked_sub(self.line_end.len())?)
+        self.config.max_width().checked_sub(self.line_end.len())
     }
 }
 
@@ -99,7 +99,7 @@ pub(crate) fn rewrite_string<'a>(
                 if is_new_line(grapheme) {
                     // take care of blank lines
                     result = trim_end_but_line_feed(fmt.trim_end, result);
-                    result.push_str("\n");
+                    result.push('\n');
                     if !is_bareline_ok && cur_start + i + 1 < graphemes.len() {
                         result.push_str(&indent_without_newline);
                         result.push_str(fmt.line_start);