use push(char) instead of push_str(&str) to add single chars to strings

clippy::single-char-push-str
This commit is contained in:
Matthias Krüger 2020-09-10 13:57:40 +02:00
parent e11c667e4a
commit 9bb10cc907
11 changed files with 31 additions and 29 deletions

View file

@ -166,14 +166,14 @@ pub mod printf {
let cap = self.span.len() + if has_options { 2 } else { 0 };
let mut s = String::with_capacity(cap);
s.push_str("{");
s.push('{');
if let Some(arg) = self.parameter {
write!(s, "{}", arg.checked_sub(1)?).ok()?;
}
if has_options {
s.push_str(":");
s.push(':');
let align = if let Some(fill) = fill {
s.push_str(fill);
@ -191,11 +191,11 @@ pub mod printf {
}
if alt {
s.push_str("#");
s.push('#');
}
if zero_fill {
s.push_str("0");
s.push('0');
}
if let Some(width) = width {
@ -203,7 +203,7 @@ pub mod printf {
}
if let Some(precision) = precision {
s.push_str(".");
s.push('.');
precision.translate(&mut s).ok()?;
}
@ -212,7 +212,7 @@ pub mod printf {
}
}
s.push_str("}");
s.push('}');
Some(s)
}
}