clippy::manual_str_repeat

This commit is contained in:
Maan2003 2021-06-13 09:37:28 +05:30
parent c50b4579ec
commit b857a5dcf0
No known key found for this signature in database
GPG key ID: E9AF024BA63C70ED
2 changed files with 3 additions and 3 deletions

View file

@ -95,7 +95,7 @@ impl fmt::Display for IndentLevel {
let indent = if len <= spaces.len() {
&spaces[..len]
} else {
buf = iter::repeat(' ').take(len).collect::<String>();
buf = " ".repeat(len);
&buf
};
fmt::Display::fmt(indent, f)

View file

@ -88,7 +88,7 @@ pub struct Ident {
}
fn print_debug_subtree(f: &mut fmt::Formatter<'_>, subtree: &Subtree, level: usize) -> fmt::Result {
let align = std::iter::repeat(" ").take(level).collect::<String>();
let align = " ".repeat(level);
let aux = match subtree.delimiter.map(|it| (it.kind, it.id.0)) {
None => "$".to_string(),
@ -113,7 +113,7 @@ fn print_debug_subtree(f: &mut fmt::Formatter<'_>, subtree: &Subtree, level: usi
}
fn print_debug_token(f: &mut fmt::Formatter<'_>, tkn: &TokenTree, level: usize) -> fmt::Result {
let align = std::iter::repeat(" ").take(level).collect::<String>();
let align = " ".repeat(level);
match tkn {
TokenTree::Leaf(leaf) => match leaf {