diff --git a/common/src/atomic.rs b/common/src/atomic.rs index b27f2d3e5..afe4afb44 100644 --- a/common/src/atomic.rs +++ b/common/src/atomic.rs @@ -56,6 +56,12 @@ pub struct OncePtr { inner: PyAtomic<*mut T>, } +impl Default for OncePtr { + fn default() -> Self { + Self::new() + } +} + impl OncePtr { #[inline] pub fn new() -> Self { diff --git a/common/src/linked_list.rs b/common/src/linked_list.rs index 0d508b94a..5834a1443 100644 --- a/common/src/linked_list.rs +++ b/common/src/linked_list.rs @@ -245,7 +245,7 @@ impl LinkedList { // === rustpython additions === - pub fn iter<'a>(&'a self) -> impl Iterator { + pub fn iter(&self) -> impl Iterator { std::iter::successors(self.head, |node| unsafe { L::pointers(*node).as_ref().get_next() }) diff --git a/vm/src/dictdatatype.rs b/vm/src/dictdatatype.rs index eed94e622..4fe19d014 100644 --- a/vm/src/dictdatatype.rs +++ b/vm/src/dictdatatype.rs @@ -605,7 +605,7 @@ impl Dict { }; match slot { Some(entry) if entry.index == index_index => { - if pred(&entry.value)? == false { + if !pred(&entry.value)? { return Ok(ControlFlow::Break(None)); } } diff --git a/vm/src/pyobjectrc.rs b/vm/src/pyobjectrc.rs index 5e844fad6..7a031de8a 100644 --- a/vm/src/pyobjectrc.rs +++ b/vm/src/pyobjectrc.rs @@ -265,7 +265,7 @@ impl WeakRefList { } impl WeakListInner { - fn iter<'a>(&'a self) -> impl Iterator> { + fn iter(&self) -> impl Iterator> { self.list.iter().filter(|wr| wr.0.refcount.get() > 0) } }