From b857a5dcf094728b4beefd652ea31d2828eb0e10 Mon Sep 17 00:00:00 2001 From: Maan2003 Date: Sun, 13 Jun 2021 09:37:28 +0530 Subject: clippy::manual_str_repeat --- crates/syntax/src/ast/edit.rs | 2 +- crates/tt/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'crates') diff --git a/crates/syntax/src/ast/edit.rs b/crates/syntax/src/ast/edit.rs index 8698687d8..2663c0759 100644 --- a/crates/syntax/src/ast/edit.rs +++ b/crates/syntax/src/ast/edit.rs @@ -95,7 +95,7 @@ impl fmt::Display for IndentLevel { let indent = if len <= spaces.len() { &spaces[..len] } else { - buf = iter::repeat(' ').take(len).collect::(); + buf = " ".repeat(len); &buf }; fmt::Display::fmt(indent, f) diff --git a/crates/tt/src/lib.rs b/crates/tt/src/lib.rs index bed44d600..b51ad5d0f 100644 --- a/crates/tt/src/lib.rs +++ b/crates/tt/src/lib.rs @@ -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::(); + 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::(); + let align = " ".repeat(level); match tkn { TokenTree::Leaf(leaf) => match leaf { -- cgit v1.2.3