Skip to content

Commit c0e5727

Browse files
committed
Rename PyValuePayload to PyObjectPayload
1 parent 070f5aa commit c0e5727

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

vm/src/pyobject.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ impl Default for PyContext {
694694
pub struct PyObject {
695695
pub typ: PyObjectRef,
696696
pub dict: Option<RefCell<PyAttributes>>, // __dict__ member
697-
pub payload: Box<dyn PyValuePayload>,
697+
pub payload: Box<dyn PyObjectPayload>,
698698
}
699699

700700
/// A reference to a Python object.
@@ -1543,7 +1543,7 @@ impl PyValue for PyIteratorValue {
15431543
}
15441544

15451545
impl PyObject {
1546-
pub fn new<T: PyValuePayload>(payload: T, typ: PyObjectRef) -> PyObjectRef {
1546+
pub fn new<T: PyObjectPayload>(payload: T, typ: PyObjectRef) -> PyObjectRef {
15471547
PyObject {
15481548
typ,
15491549
dict: Some(RefCell::new(PyAttributes::new())),
@@ -1567,17 +1567,17 @@ pub trait PyValue: fmt::Debug + 'static {
15671567
fn required_type(ctx: &PyContext) -> PyObjectRef;
15681568
}
15691569

1570-
pub trait PyValuePayload: Any + fmt::Debug + 'static {
1570+
pub trait PyObjectPayload: Any + fmt::Debug + 'static {
15711571
fn required_type(&self, ctx: &PyContext) -> PyObjectRef;
15721572
}
15731573

1574-
impl<T: PyValue + 'static> PyValuePayload for T {
1574+
impl<T: PyValue + 'static> PyObjectPayload for T {
15751575
fn required_type(&self, ctx: &PyContext) -> PyObjectRef {
15761576
T::required_type(ctx)
15771577
}
15781578
}
15791579

1580-
impl PyValuePayload for () {
1580+
impl PyObjectPayload for () {
15811581
fn required_type(&self, _ctx: &PyContext) -> PyObjectRef {
15821582
panic!("No specific python type for rust unit, don't type check")
15831583
}

0 commit comments

Comments
 (0)