Use push_str() instead of write!()

This commit is contained in:
topecongiro 2017-10-05 21:05:28 +09:00
parent ce8e645537
commit 47cf912c2c

View File

@ -10,7 +10,6 @@
use std::cmp::min;
use std::borrow::Cow;
use std::fmt::Write;
use std::iter::{repeat, ExactSizeIterator};
use syntax::{ast, ptr};
@ -1351,14 +1350,14 @@ fn rewrite(&self, context: &RewriteContext, shape: Shape) -> Option<String> {
ControlBraceStyle::AlwaysNextLine if last_in_chain => &*alt_block_sep,
_ => " ",
};
write!(
&mut result,
result.push_str(&format!(
"{}else{}",
between_kwd_else_block_comment
.as_ref()
.map_or(between_sep, |s| &**s),
after_else_comment.as_ref().map_or(after_sep, |s| &**s)
).ok()?;
after_else_comment.as_ref().map_or(after_sep, |s| &**s),
));
result.push_str(&rewrite?);
}