@@ -19,8 +19,8 @@ use crate::{
19
19
sliceable:: wrap_index,
20
20
types:: { AsBuffer , AsMapping , AsSequence , Comparable , Constructor , Hashable , PyComparisonOp } ,
21
21
utils:: Either ,
22
- AsObject , PyContext , PyObject , PyObjectRef , PyObjectView , PyObjectWrap , PyRef , PyResult ,
23
- PyValue , TryFromBorrowedObject , TryFromObject , VirtualMachine ,
22
+ AsObject , PyContext , PyObject , PyObjectRef , PyObjectView , PyRef , PyResult , PyValue ,
23
+ TryFromBorrowedObject , TryFromObject , VirtualMachine ,
24
24
} ;
25
25
use crossbeam_utils:: atomic:: AtomicCell ;
26
26
use itertools:: Itertools ;
@@ -255,7 +255,7 @@ impl PyMemoryView {
255
255
other. init_slice ( slice, 0 , vm) ?;
256
256
other. init_len ( ) ;
257
257
258
- Ok ( other. into_ref ( vm) . into_object ( ) )
258
+ Ok ( other. into_ref ( vm) . into ( ) )
259
259
}
260
260
261
261
fn getitem_by_multi_idx ( & self , indexes : & [ isize ] , vm : & VirtualMachine ) -> PyResult {
@@ -270,7 +270,7 @@ impl PyMemoryView {
270
270
if zelf. desc . ndim ( ) == 0 {
271
271
// 0-d memoryview can be referenced using mv[...] or mv[()] only
272
272
if needle. is ( & vm. ctx . ellipsis ) {
273
- return Ok ( zelf. into_object ( ) ) ;
273
+ return Ok ( zelf. into ( ) ) ;
274
274
}
275
275
if let Some ( tuple) = needle. payload :: < PyTuple > ( ) {
276
276
if tuple. is_empty ( ) {
@@ -539,9 +539,7 @@ impl PyMemoryView {
539
539
540
540
let mut v = Vec :: with_capacity ( shape) ;
541
541
for _ in 0 ..shape {
542
- let obj = self
543
- . _to_list ( bytes, index + suboffset, dim + 1 , vm) ?
544
- . into_object ( ) ;
542
+ let obj = self . _to_list ( bytes, index + suboffset, dim + 1 , vm) ?. into ( ) ;
545
543
v. push ( obj) ;
546
544
index += stride;
547
545
}
@@ -938,7 +936,7 @@ impl AsBuffer for PyMemoryView {
938
936
Err ( vm. new_value_error ( "operation forbidden on released memoryview object" . to_owned ( ) ) )
939
937
} else {
940
938
Ok ( PyBuffer :: new (
941
- zelf. to_owned ( ) . into_object ( ) ,
939
+ zelf. to_owned ( ) . into ( ) ,
942
940
zelf. desc . clone ( ) ,
943
941
& BUFFER_METHODS ,
944
942
) )
0 commit comments