diff --git a/vm/src/obj/objproperty.rs b/vm/src/obj/objproperty.rs index c44a4350bc..7cb4ea8498 100644 --- a/vm/src/obj/objproperty.rs +++ b/vm/src/obj/objproperty.rs @@ -2,8 +2,6 @@ */ -use std::marker::PhantomData; - use crate::obj::objstr::PyStringRef; use crate::obj::objtype::PyClassRef; use crate::pyobject::{ @@ -92,30 +90,27 @@ impl PyPropertyRef { } } -pub struct PropertyBuilder<'a, T> { +pub struct PropertyBuilder<'a> { ctx: &'a PyContext, getter: Option, setter: Option, - _return: PhantomData, } -impl<'a, T> PropertyBuilder<'a, T> { +impl<'a> PropertyBuilder<'a> { pub fn new(ctx: &'a PyContext) -> Self { Self { ctx, getter: None, setter: None, - _return: PhantomData, } } - pub fn add_getter>(self, func: F) -> Self { + pub fn add_getter>(self, func: F) -> Self { let func = self.ctx.new_rustfunc(func); Self { ctx: self.ctx, getter: Some(func), setter: self.setter, - _return: PhantomData, } } @@ -125,7 +120,6 @@ impl<'a, T> PropertyBuilder<'a, T> { ctx: self.ctx, getter: self.getter, setter: Some(func), - _return: PhantomData, } } diff --git a/vm/src/pyobject.rs b/vm/src/pyobject.rs index 0535779487..d23c68b665 100644 --- a/vm/src/pyobject.rs +++ b/vm/src/pyobject.rs @@ -596,9 +596,9 @@ impl PyContext { PyObject::new(Frame::new(code, scope), self.frame_type()) } - pub fn new_property(&self, f: F) -> PyObjectRef + pub fn new_property(&self, f: F) -> PyObjectRef where - F: IntoPyNativeFunc, + F: IntoPyNativeFunc, { PropertyBuilder::new(self).add_getter(f).create() }