Skip to content

Commit ffd474d

Browse files
committed
chore: Make Clippy happy to unblock the CI.
This patch makes Clippy happy so that the CI job _Lints_ can run again.
1 parent 4253de9 commit ffd474d

6 files changed

Lines changed: 12 additions & 12 deletions

File tree

matcher/src/score.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl Config {
6767
} else if class == CharClass::Whitespace {
6868
self.bonus_boundary_white
6969
} else if class == CharClass::NonWord {
70-
return BONUS_NON_WORD;
70+
BONUS_NON_WORD
7171
} else {
7272
0
7373
}

matcher/src/utf32_str.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ impl Utf32String {
335335
/// Creates a slice with a string that contains the characters in
336336
/// the specified **character range**.
337337
#[inline]
338-
pub fn slice(&self, range: impl RangeBounds<usize>) -> Utf32Str {
338+
pub fn slice(&self, range: impl RangeBounds<usize>) -> Utf32Str<'_> {
339339
let start = match range.start_bound() {
340340
Bound::Included(&start) => start,
341341
Bound::Excluded(&start) => start + 1,
@@ -355,7 +355,7 @@ impl Utf32String {
355355
/// Same as `slice` but accepts a u32 range for convenience since
356356
/// those are the indices returned by the matcher.
357357
#[inline]
358-
pub fn slice_u32(&self, range: impl RangeBounds<u32>) -> Utf32Str {
358+
pub fn slice_u32(&self, range: impl RangeBounds<u32>) -> Utf32Str<'_> {
359359
let start = match range.start_bound() {
360360
Bound::Included(&start) => start,
361361
Bound::Excluded(&start) => start + 1,

src/boxcar.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ mod tests {
780780
fn extend_over_max_capacity() {
781781
let vec = Vec::<u32>::with_capacity(1, 1);
782782
let count = MAX_ENTRIES as usize + 2;
783-
let iter = std::iter::repeat(0).take(count);
783+
let iter = std::iter::repeat_n(0, count);
784784
assert!(std::panic::catch_unwind(|| vec.extend(iter, |_, _| {})).is_err());
785785
}
786786
}

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub struct Item<'a, T> {
5858
/// and sent across threads.
5959
pub struct Injector<T> {
6060
items: Arc<boxcar::Vec<T>>,
61-
notify: Arc<(dyn Fn() + Sync + Send)>,
61+
notify: Arc<dyn Fn() + Sync + Send>,
6262
}
6363

6464
impl<T> Clone for Injector<T> {
@@ -84,10 +84,10 @@ impl<T> Injector<T> {
8484
///
8585
/// You should favor this function over `push` if at least one of the following is true:
8686
/// - the number of items you're adding can be computed beforehand and is typically larger
87-
/// than 1k
87+
/// than 1k
8888
/// - you're able to batch incoming items
8989
/// - you're adding items from multiple threads concurrently (this function results in less
90-
/// contention)
90+
/// contention)
9191
pub fn extend<I>(&self, values: I, fill_columns: impl Fn(&T, &mut [Utf32String]))
9292
where
9393
I: IntoIterator<Item = T> + ExactSizeIterator,
@@ -283,7 +283,7 @@ pub struct Nucleo<T: Sync + Send + 'static> {
283283
pool: ThreadPool,
284284
state: State,
285285
items: Arc<boxcar::Vec<T>>,
286-
notify: Arc<(dyn Fn() + Sync + Send)>,
286+
notify: Arc<dyn Fn() + Sync + Send>,
287287
snapshot: Snapshot<T>,
288288
/// The pattern matched by this matcher. To update the match pattern
289289
/// [`MultiPattern::reparse`](`pattern::MultiPattern::reparse`) should be used.
@@ -308,7 +308,7 @@ impl<T: Sync + Send + 'static> Nucleo<T> {
308308
/// number of columns cannot be changed after construction.
309309
pub fn new(
310310
config: Config,
311-
notify: Arc<(dyn Fn() + Sync + Send)>,
311+
notify: Arc<dyn Fn() + Sync + Send>,
312312
num_threads: Option<usize>,
313313
columns: u32,
314314
) -> Self {

src/pattern.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ impl MultiPattern {
5656
.0
5757
.atoms
5858
.last()
59-
.map_or(true, |last| !last.negative)
59+
.is_none_or(|last| !last.negative)
6060
{
6161
self.cols[column].1 = Status::Update;
6262
} else {

src/worker.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub(crate) struct Worker<T: Sync + Send + 'static> {
3535
pub(crate) should_notify: Arc<AtomicBool>,
3636
pub(crate) was_canceled: bool,
3737
pub(crate) last_snapshot: u32,
38-
notify: Arc<(dyn Fn() + Sync + Send)>,
38+
notify: Arc<dyn Fn() + Sync + Send>,
3939
pub(crate) items: Arc<boxcar::Vec<T>>,
4040
in_flight: Vec<u32>,
4141
}
@@ -59,7 +59,7 @@ impl<T: Sync + Send + 'static> Worker<T> {
5959
pub(crate) fn new(
6060
worker_threads: Option<usize>,
6161
config: Config,
62-
notify: Arc<(dyn Fn() + Sync + Send)>,
62+
notify: Arc<dyn Fn() + Sync + Send>,
6363
cols: u32,
6464
) -> (ThreadPool, Self) {
6565
let worker_threads = worker_threads

0 commit comments

Comments
 (0)