Skip to content

Commit 35ea4b5

Browse files
committed
call PyLease::into_owned as method
1 parent 9ecc95d commit 35ea4b5

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

vm/src/builtins/pytype.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use crate::common::{
1010
use crate::{
1111
function::{FuncArgs, KwArgs, OptionalArg},
1212
pyclass::{PyClassImpl, StaticType},
13-
pyobject::PyLease,
1413
types::{Callable, GetAttr, PyTypeFlags, PyTypeSlots, SetAttr},
1514
AsPyObject, PyContext, PyObjectRef, PyObjectWeak, PyRef, PyResult, PyValue, VirtualMachine,
1615
};
@@ -647,7 +646,7 @@ impl GetAttr for PyType {
647646
.is_some()
648647
{
649648
if let Some(descr_get) = attr_class.mro_find_map(|cls| cls.slots.descr_get.load()) {
650-
let mcl = PyLease::into_owned(mcl).into();
649+
let mcl = mcl.into_owned().into();
651650
return descr_get(attr.clone(), Some(zelf.into()), Some(mcl), vm);
652651
}
653652
}
@@ -874,7 +873,7 @@ fn calculate_meta_class(
874873
if winner.fast_issubclass(&base_type) {
875874
continue;
876875
} else if base_type.fast_issubclass(&winner) {
877-
winner = PyLease::into_owned(base_type);
876+
winner = base_type.into_owned();
878877
continue;
879878
}
880879

vm/src/pyobject.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -746,7 +746,7 @@ impl PyMethod {
746746
.is_some()
747747
{
748748
drop(descr_cls);
749-
let cls = PyLease::into_owned(cls).into();
749+
let cls = cls.into_owned().into();
750750
return descr_get(descr, Some(obj), Some(cls), vm).map(Self::Attribute);
751751
}
752752
}
@@ -774,7 +774,7 @@ impl PyMethod {
774774
})
775775
}
776776
Some(descr_get) => {
777-
let cls = PyLease::into_owned(cls).into();
777+
let cls = cls.into_owned().into();
778778
descr_get(attr, Some(obj), Some(cls), vm).map(Self::Attribute)
779779
}
780780
None => Ok(Self::Attribute(attr)),
@@ -815,7 +815,7 @@ impl PyMethod {
815815
drop(obj_cls);
816816
Self::Function { target: obj, func }
817817
} else {
818-
let obj_cls = PyLease::into_owned(obj_cls).into();
818+
let obj_cls = obj_cls.into_owned().into();
819819
let attr = vm
820820
.call_get_descriptor_specific(func, Some(obj), Some(obj_cls))
821821
.unwrap_or_else(Ok)?;

vm/src/vm.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ use crate::{
2323
function::{ArgMapping, FuncArgs},
2424
import,
2525
protocol::PyIterIter,
26-
pyobject::PyLease,
2726
scope::Scope,
2827
signal, stdlib, AsPyObject, PyContext, PyObject, PyObjectRef, PyRef, PyRefExact, PyResult,
2928
PyValue,
@@ -785,7 +784,7 @@ impl VirtualMachine {
785784
.is_some()
786785
{
787786
drop(descr_cls);
788-
let cls = PyLease::into_owned(obj_cls).into();
787+
let cls = obj_cls.into_owned().into();
789788
return descr_get(descr, Some(obj), Some(cls), self).map(Some);
790789
}
791790
}
@@ -808,7 +807,7 @@ impl VirtualMachine {
808807
} else if let Some((attr, descr_get)) = cls_attr {
809808
match descr_get {
810809
Some(descr_get) => {
811-
let cls = PyLease::into_owned(obj_cls).into();
810+
let cls = obj_cls.into_owned().into();
812811
descr_get(attr, Some(obj), Some(cls), self).map(Some)
813812
}
814813
None => Ok(Some(attr)),

0 commit comments

Comments
 (0)