mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +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() {
|
let indent = if len <= spaces.len() {
|
||||||
&spaces[..len]
|
&spaces[..len]
|
||||||
} else {
|
} else {
|
||||||
buf = iter::repeat(' ').take(len).collect::<String>();
|
buf = " ".repeat(len);
|
||||||
&buf
|
&buf
|
||||||
};
|
};
|
||||||
fmt::Display::fmt(indent, f)
|
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 {
|
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)) {
|
let aux = match subtree.delimiter.map(|it| (it.kind, it.id.0)) {
|
||||||
None => "$".to_string(),
|
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 {
|
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 {
|
match tkn {
|
||||||
TokenTree::Leaf(leaf) => match leaf {
|
TokenTree::Leaf(leaf) => match leaf {
|
||||||
|
|
Loading…
Reference in a new issue