Skip to content

Commit 47cf912

Browse files
committed
Use push_str() instead of write!()
1 parent ce8e645 commit 47cf912

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/expr.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
use std::cmp::min;
1212
use std::borrow::Cow;
13-
use std::fmt::Write;
1413
use std::iter::{repeat, ExactSizeIterator};
1514

1615
use syntax::{ast, ptr};
@@ -1351,14 +1350,14 @@ impl<'a> Rewrite for ControlFlow<'a> {
13511350
ControlBraceStyle::AlwaysNextLine if last_in_chain => &*alt_block_sep,
13521351
_ => " ",
13531352
};
1354-
write!(
1355-
&mut result,
1353+
1354+
result.push_str(&format!(
13561355
"{}else{}",
13571356
between_kwd_else_block_comment
13581357
.as_ref()
13591358
.map_or(between_sep, |s| &**s),
1360-
after_else_comment.as_ref().map_or(after_sep, |s| &**s)
1361-
).ok()?;
1359+
after_else_comment.as_ref().map_or(after_sep, |s| &**s),
1360+
));
13621361
result.push_str(&rewrite?);
13631362
}
13641363

0 commit comments

Comments
 (0)