mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-25 12:33:33 +00:00
clippy::manual_str_repeat
This commit is contained in:
parent
c50b4579ec
commit
b857a5dcf0
2 changed files with 3 additions and 3 deletions
|
@ -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)
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue