|
1 | 1 | //! Implementation of the python bytearray object. |
2 | 2 | use super::{ |
3 | | - PositionIterInternal, PyBytes, PyBytesRef, PyDictRef, PyIntRef, PyStr, PyStrRef, PyTuple, |
4 | | - PyTupleRef, PyType, PyTypeRef, |
| 3 | + PositionIterInternal, PyBytes, PyBytesRef, PyDictRef, PyIntRef, PyStrRef, PyTuple, PyTupleRef, |
| 4 | + PyType, PyTypeRef, |
5 | 5 | }; |
6 | 6 | use crate::{ |
7 | 7 | anystr::{self, AnyStr}, |
@@ -294,7 +294,7 @@ impl PyByteArray { |
294 | 294 | } |
295 | 295 | } |
296 | 296 |
|
297 | | - fn irepeat(zelf: &crate::Py<Self>, n: isize, vm: &VirtualMachine) -> PyResult<()> { |
| 297 | + fn irepeat(zelf: &Py<Self>, n: isize, vm: &VirtualMachine) -> PyResult<()> { |
298 | 298 | if n == 1 { |
299 | 299 | return Ok(()); |
300 | 300 | } |
@@ -733,7 +733,7 @@ impl Initializer for PyByteArray { |
733 | 733 |
|
734 | 734 | impl Comparable for PyByteArray { |
735 | 735 | fn cmp( |
736 | | - zelf: &crate::Py<Self>, |
| 736 | + zelf: &Py<Self>, |
737 | 737 | other: &PyObject, |
738 | 738 | op: PyComparisonOp, |
739 | 739 | vm: &VirtualMachine, |
@@ -882,12 +882,10 @@ impl Iterable for PyByteArray { |
882 | 882 |
|
883 | 883 | impl Representable for PyByteArray { |
884 | 884 | #[inline] |
885 | | - fn repr(zelf: &crate::Py<Self>, vm: &VirtualMachine) -> PyResult<PyStrRef> { |
| 885 | + fn repr_str(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<String> { |
886 | 886 | let class = zelf.class(); |
887 | 887 | let class_name = class.name(); |
888 | | - zelf.inner() |
889 | | - .repr(Some(&class_name), vm) |
890 | | - .map(|s| PyStr::from(s).into_ref(vm)) |
| 888 | + zelf.inner().repr(Some(&class_name), vm) |
891 | 889 | } |
892 | 890 | } |
893 | 891 |
|
@@ -932,7 +930,7 @@ impl Unconstructible for PyByteArrayIterator {} |
932 | 930 |
|
933 | 931 | impl IterNextIterable for PyByteArrayIterator {} |
934 | 932 | impl IterNext for PyByteArrayIterator { |
935 | | - fn next(zelf: &crate::Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> { |
| 933 | + fn next(zelf: &Py<Self>, vm: &VirtualMachine) -> PyResult<PyIterReturn> { |
936 | 934 | zelf.internal.lock().next(|bytearray, pos| { |
937 | 935 | let buf = bytearray.borrow_buf(); |
938 | 936 | Ok(PyIterReturn::from_result( |
|
0 commit comments