Skip to content

Commit

Permalink
Adhere to Clippy provided suggestions
Browse files Browse the repository at this point in the history
Implement a couple of suggestions made by Clippy in newer versions of
Rust.
  • Loading branch information
d-e-s-o committed Feb 23, 2025
1 parent 9cb9fb4 commit ca34d4f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/cap.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2022 Daniel Mueller ([email protected])
// Copyright (C) 2022-2025 Daniel Mueller ([email protected])
// SPDX-License-Identifier: GPL-3.0-or-later

//! A module providing the means for protecting the contents of a
Expand Down Expand Up @@ -302,7 +302,7 @@ pub struct FileCap<'cap> {
_phantom: PhantomData<&'cap ()>,
}

impl<'cap> FileCap<'cap> {
impl FileCap<'_> {
/// Create a new [`FileCap`] for the provided path.
fn new(path: PathBuf) -> Self {
Self {
Expand Down
6 changes: 3 additions & 3 deletions src/db.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2022-2024 Daniel Mueller ([email protected])
// Copyright (C) 2022-2025 Daniel Mueller ([email protected])
// SPDX-License-Identifier: GPL-3.0-or-later

use std::cell::Cell;
Expand Down Expand Up @@ -806,7 +806,7 @@ pub mod tests {

for item in items.iter() {
assert!(db
.try_insert(black_box(0), black_box(item.clone()))
.try_insert(black_box(0), black_box(Rc::clone(item)))
.is_some());
}
});
Expand Down Expand Up @@ -837,7 +837,7 @@ pub mod tests {
let () = db.data.reserve(ITEM_CNT);

for item in items.iter() {
assert!(db.try_push(black_box(Rc::clone(&item))).is_some());
assert!(db.try_push(black_box(Rc::clone(item))).is_some());
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/view.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2017-2024 Daniel Mueller ([email protected])
// Copyright (C) 2017-2025 Daniel Mueller ([email protected])
// SPDX-License-Identifier: GPL-3.0-or-later

use std::rc::Rc;
Expand Down Expand Up @@ -123,7 +123,7 @@ impl<'tasks> Iterator for Filter<'tasks> {
}
}

impl<'tasks> DoubleEndedIterator for Filter<'tasks> {
impl DoubleEndedIterator for Filter<'_> {
fn next_back(&mut self) -> Option<Self::Item> {
loop {
match self.iter.next_back() {
Expand Down

0 comments on commit ca34d4f

Please sign in to comment.