mirror of
https://github.com/RustPython/RustPython.git
synced 2026-06-09 22:49:57 +09:00
Apply staticmethod to maketrans
https://docs.python.org/3.10/library/stdtypes.html?highlight=maketrans#str.maketrans
This commit is contained in:
@@ -227,7 +227,7 @@ impl PyByteArray {
|
||||
}
|
||||
}
|
||||
|
||||
#[pymethod]
|
||||
#[pystaticmethod]
|
||||
fn maketrans(from: PyBytesInner, to: PyBytesInner, vm: &VirtualMachine) -> PyResult<Vec<u8>> {
|
||||
PyBytesInner::maketrans(from, to, vm)
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ impl PyBytes {
|
||||
self.inner.contains(needle, vm)
|
||||
}
|
||||
|
||||
#[pymethod]
|
||||
#[pystaticmethod]
|
||||
fn maketrans(from: PyBytesInner, to: PyBytesInner, vm: &VirtualMachine) -> PyResult<Vec<u8>> {
|
||||
PyBytesInner::maketrans(from, to, vm)
|
||||
}
|
||||
|
||||
@@ -1141,7 +1141,7 @@ impl PyStr {
|
||||
Ok(translated)
|
||||
}
|
||||
|
||||
#[pymethod]
|
||||
#[pystaticmethod]
|
||||
fn maketrans(
|
||||
dict_or_str: PyObjectRef,
|
||||
to_str: OptionalArg<PyStrRef>,
|
||||
|
||||
Reference in New Issue
Block a user