Skip to content

Commit 9a1bbe9

Browse files
committed
use repeat_n() where available
1 parent 544f71f commit 9a1bbe9

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

clippy_lints/src/doc/lazy_continuation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ pub(super) fn check(
5757
diag.span_suggestion_verbose(
5858
span.shrink_to_hi(),
5959
"indent this line",
60-
std::iter::repeat(" ").take(indent).join(""),
60+
std::iter::repeat_n(" ", indent).join(""),
6161
Applicability::MaybeIncorrect,
6262
);
6363
diag.help("if this is supposed to be its own paragraph, add a blank line");

clippy_utils/src/lib.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
clippy::missing_errors_doc,
1616
clippy::missing_panics_doc,
1717
clippy::must_use_candidate,
18-
clippy::manual_repeat_n,
1918
rustc::diagnostic_outside_of_impl,
2019
rustc::untranslatable_diagnostic
2120
)]
@@ -89,7 +88,7 @@ use core::mem;
8988
use core::ops::ControlFlow;
9089
use std::collections::hash_map::Entry;
9190
use std::hash::BuildHasherDefault;
92-
use std::iter::{once, repeat};
91+
use std::iter::{once, repeat_n};
9392
use std::sync::{Mutex, MutexGuard, OnceLock};
9493

9594
use itertools::Itertools;
@@ -3421,7 +3420,7 @@ fn maybe_get_relative_path(from: &DefPath, to: &DefPath, max_super: usize) -> St
34213420
}))
34223421
.join("::")
34233422
} else {
3424-
repeat(String::from("super")).take(go_up_by).chain(path).join("::")
3423+
repeat_n(String::from("super"), go_up_by).chain(path).join("::")
34253424
}
34263425
}
34273426

0 commit comments

Comments
 (0)