Skip to content

Commit 1da239a

Browse files
committed
Fix clippy
1 parent 2a87b89 commit 1da239a

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

common/src/atomic.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,12 @@ pub struct OncePtr<T> {
5656
inner: PyAtomic<*mut T>,
5757
}
5858

59+
impl<T> Default for OncePtr<T> {
60+
fn default() -> Self {
61+
Self::new()
62+
}
63+
}
64+
5965
impl<T> OncePtr<T> {
6066
#[inline]
6167
pub fn new() -> Self {

common/src/linked_list.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ impl<L: Link> LinkedList<L, L::Target> {
245245

246246
// === rustpython additions ===
247247

248-
pub fn iter<'a>(&'a self) -> impl Iterator<Item = &'a L::Target> {
248+
pub fn iter(&self) -> impl Iterator<Item = &L::Target> {
249249
std::iter::successors(self.head, |node| unsafe {
250250
L::pointers(*node).as_ref().get_next()
251251
})

vm/src/dictdatatype.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ impl<T: Clone> Dict<T> {
605605
};
606606
match slot {
607607
Some(entry) if entry.index == index_index => {
608-
if pred(&entry.value)? == false {
608+
if !pred(&entry.value)? {
609609
return Ok(ControlFlow::Break(None));
610610
}
611611
}

vm/src/pyobjectrc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ impl WeakRefList {
265265
}
266266

267267
impl WeakListInner {
268-
fn iter<'a>(&'a self) -> impl Iterator<Item = &'a PyObjectView<PyWeak>> {
268+
fn iter(&self) -> impl Iterator<Item = &PyObjectView<PyWeak>> {
269269
self.list.iter().filter(|wr| wr.0.refcount.get() > 0)
270270
}
271271
}

0 commit comments

Comments
 (0)