Fix clippy

This commit is contained in:
Noa committed 2021-11-15 16:08:47 -06:00
1 parent 2a87b893fb
commit 1da239ac08
4 files changed
+9 -3

No files matched your search

+6
View File
@@ -56,6 +56,12 @@ pub struct OncePtr<T> {
inner: PyAtomic<*mut T>,
}
impl<T> Default for OncePtr<T> {
fn default() -> Self {
Self::new()
}
}
impl<T> OncePtr<T> {
#[inline]
pub fn new() -> Self {
+1 -1
View File
@@ -245,7 +245,7 @@ impl<L: Link> LinkedList<L, L::Target> {
// === rustpython additions ===
pub fn iter<'a>(&'a self) -> impl Iterator<Item = &'a L::Target> {
pub fn iter(&self) -> impl Iterator<Item = &L::Target> {
std::iter::successors(self.head, |node| unsafe {
L::pointers(*node).as_ref().get_next()
})
+1 -1
View File
@@ -605,7 +605,7 @@ impl<T: Clone> Dict<T> {
};
match slot {
Some(entry) if entry.index == index_index => {
if pred(&entry.value)? == false {
if !pred(&entry.value)? {
return Ok(ControlFlow::Break(None));
}
}
+1 -1
View File
@@ -265,7 +265,7 @@ impl WeakRefList {
}
impl WeakListInner {
fn iter<'a>(&'a self) -> impl Iterator<Item = &'a PyObjectView<PyWeak>> {
fn iter(&self) -> impl Iterator<Item = &PyObjectView<PyWeak>> {
self.list.iter().filter(|wr| wr.0.refcount.get() > 0)
}
}