Implement new clippy lints (#5208)

* Implement new clippy lints

clippy was just updated and has a few minor issues with the code base.

* Forgotten lint hidden behind feature
This commit is contained in:
Daniel Chiquito
2024-03-21 21:25:53 -04:00
committed by GitHub
parent 85c427b842
commit 90724b32ec
4 changed files with 4 additions and 4 deletions

View File

@@ -46,7 +46,7 @@ mod non_threading {
F: FnOnce() -> Result<T, E>,
{
self.inner
.with(|x| x.get_or_try_init(|| f().map(leak)).map(|&x| x))
.with(|x| x.get_or_try_init(|| f().map(leak)).copied())
}
}

View File

@@ -250,7 +250,7 @@ pub mod levenshtein {
pub fn levenshtein_distance(a: &str, b: &str, max_cost: usize) -> usize {
thread_local! {
static BUFFER: RefCell<[usize; MAX_STRING_SIZE]> = RefCell::new([0usize; MAX_STRING_SIZE]);
static BUFFER: RefCell<[usize; MAX_STRING_SIZE]> = const { RefCell::new([0usize; MAX_STRING_SIZE]) };
}
if a == b {

View File

@@ -1047,7 +1047,7 @@ impl Hashable for PyMemoryView {
}
Ok(zelf.contiguous_or_collect(|bytes| vm.state.hash_secret.hash_bytes(bytes)))
})
.map(|&x| x)
.copied()
}
}

View File

@@ -698,7 +698,7 @@ pub(super) mod _os {
if self.is_symlink(vm)? {
do_stat(true)
} else {
lstat().map(Clone::clone)
lstat().cloned()
}
})?
} else {