mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-17 01:51:39 +09:00
match_class! macro
This commit is contained in:
@@ -16,6 +16,12 @@ pub struct PyFloat {
|
||||
value: f64,
|
||||
}
|
||||
|
||||
impl PyFloat {
|
||||
pub fn to_f64(&self) -> f64 {
|
||||
self.value
|
||||
}
|
||||
}
|
||||
|
||||
impl PyValue for PyFloat {
|
||||
fn class(vm: &VirtualMachine) -> PyClassRef {
|
||||
vm.ctx.float_type()
|
||||
|
||||
Reference in New Issue
Block a user