Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix clippy warnings: remove unused into_inner, collapse nested if-let
  • Loading branch information
alok-108 committed Apr 7, 2026
commit 7651712c7336d919d6b7312bd07fb74d41f28c4c
11 changes: 2 additions & 9 deletions crates/vm/src/object/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -954,11 +954,6 @@ impl InstanceDict {
core::mem::replace(&mut self.d.write(), d)
}

/// Consume the InstanceDict and return the inner Option<PyDictRef>.
#[inline]
pub fn into_inner(self) -> Option<PyDictRef> {
self.d.into_inner()
}

pub(crate) fn get_or_insert(&self, vm: &VirtualMachine) -> PyDictRef {
if let Some(existing) = self.d.read().as_ref() {
Expand Down Expand Up @@ -1800,10 +1795,8 @@ impl PyObject {
let ext_ptr =
core::ptr::with_exposed_provenance_mut::<ObjExt>(self_addr.wrapping_sub(offset));
let ext = unsafe { &mut *ext_ptr };
if let Some(instance_dict) = &ext.dict {
if let Some(dict_ref) = instance_dict.replace(None) {
result.push(dict_ref.into());
}
if let Some(dict_ref) = ext.dict.as_ref().and_then(|d| d.replace(None)) {
result.push(dict_ref.into());
}
for slot in ext.slots.iter() {
if let Some(val) = slot.write().take() {
Expand Down
Loading