mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-02 19:39:49 +09:00
Replace PyInquiryFunc to PyUnaryFunc<bool>
Signed-off-by: snowapril <sinjihng@gmail.com>
This commit is contained in:
@@ -11,7 +11,6 @@ use crate::{
|
||||
VirtualMachine,
|
||||
};
|
||||
|
||||
pub type PyNumberInquiryFunc = fn(PyNumber, &VirtualMachine) -> PyResult<bool>;
|
||||
pub type PyNumberUnaryFunc<R = PyObjectRef> = fn(PyNumber, &VirtualMachine) -> PyResult<R>;
|
||||
pub type PyNumberBinaryFunc = fn(&PyObject, &PyObject, &VirtualMachine) -> PyResult;
|
||||
pub type PyNumberTernaryFunc = fn(&PyObject, &PyObject, &PyObject, &VirtualMachine) -> PyResult;
|
||||
@@ -127,7 +126,7 @@ pub struct PyNumberMethods {
|
||||
pub negative: Option<PyNumberUnaryFunc>,
|
||||
pub positive: Option<PyNumberUnaryFunc>,
|
||||
pub absolute: Option<PyNumberUnaryFunc>,
|
||||
pub boolean: Option<PyNumberInquiryFunc>,
|
||||
pub boolean: Option<PyNumberUnaryFunc<bool>>,
|
||||
pub invert: Option<PyNumberUnaryFunc>,
|
||||
pub lshift: Option<PyNumberBinaryFunc>,
|
||||
pub rshift: Option<PyNumberBinaryFunc>,
|
||||
@@ -251,7 +250,7 @@ pub struct PyNumberSlots {
|
||||
pub negative: AtomicCell<Option<PyNumberUnaryFunc>>,
|
||||
pub positive: AtomicCell<Option<PyNumberUnaryFunc>>,
|
||||
pub absolute: AtomicCell<Option<PyNumberUnaryFunc>>,
|
||||
pub boolean: AtomicCell<Option<PyNumberInquiryFunc>>,
|
||||
pub boolean: AtomicCell<Option<PyNumberUnaryFunc<bool>>>,
|
||||
pub invert: AtomicCell<Option<PyNumberUnaryFunc>>,
|
||||
pub lshift: AtomicCell<Option<PyNumberBinaryFunc>>,
|
||||
pub rshift: AtomicCell<Option<PyNumberBinaryFunc>>,
|
||||
|
||||
Reference in New Issue
Block a user