Remove PyObjectPayload

This commit is contained in:
Joey Hain
2019-03-10 13:45:38 -07:00
parent 45bc8c8f7a
commit e2e13af7ea
26 changed files with 210 additions and 468 deletions

View File

@@ -3,8 +3,7 @@ use super::objint;
use super::objstr;
use super::objtype;
use crate::pyobject::{
IntoPyObject, PyContext, PyObject, PyObjectPayload, PyObjectPayload2, PyObjectRef, PyRef,
PyResult, TypeProtocol,
IntoPyObject, PyContext, PyObject, PyObjectPayload2, PyObjectRef, PyRef, PyResult, TypeProtocol,
};
use crate::vm::VirtualMachine;
use num_bigint::ToBigInt;
@@ -189,12 +188,7 @@ impl PyFloatRef {
let type_name = objtype::get_type_name(&arg.typ());
return Err(vm.new_type_error(format!("can't convert {} to float", type_name)));
};
Ok(PyObject::new(
PyObjectPayload::AnyRustValue {
value: Box::new(PyFloat { value }),
},
cls.clone(),
))
Ok(PyObject::new(Box::new(PyFloat { value }), cls.clone()))
}
fn mod_(self, other: PyObjectRef, vm: &mut VirtualMachine) -> PyResult {