@@ -18,8 +18,8 @@ mod array {
1818 } ,
1919 class_or_notimplemented,
2020 function:: {
21- ArgBytesLike , ArgIntoFloat , ArgIterable , IntoPyObject , IntoPyResult , OptionalArg ,
22- PyComparisonValue ,
21+ ArgBytesLike , ArgIntoFloat , ArgIterable , OptionalArg , PyComparisonValue ,
22+ ToPyObject , ToPyResult ,
2323 } ,
2424 protocol:: {
2525 BufferDescriptor , BufferMethods , BufferResizeGuard , PyBuffer , PyIterReturn ,
@@ -117,7 +117,7 @@ mod array {
117117 let i = v. wrap_index( i) . ok_or_else( || {
118118 vm. new_index_error( "pop index out of range" . to_owned( ) )
119119 } ) ?;
120- v. remove( i) . into_pyresult ( vm)
120+ v. remove( i) . to_pyresult ( vm)
121121 } ) *
122122 }
123123 }
@@ -258,15 +258,15 @@ mod array {
258258 ) -> Option <PyResult > {
259259 match self {
260260 $( ArrayContentType :: $n( v) => {
261- v. get( i) . map( |x| x. into_pyresult ( vm) )
261+ v. get( i) . map( |x| x. to_pyresult ( vm) )
262262 } ) *
263263 }
264264 }
265265
266266 fn getitem_by_index( & self , i: isize , vm: & VirtualMachine ) -> PyResult {
267267 match self {
268268 $( ArrayContentType :: $n( v) => {
269- v. get_item_by_index( vm, i) . map( |x| x. into_pyresult ( vm) ) ?
269+ v. get_item_by_index( vm, i) . map( |x| x. to_pyresult ( vm) ) ?
270270 } ) *
271271 }
272272 }
@@ -276,7 +276,7 @@ mod array {
276276 $( ArrayContentType :: $n( v) => {
277277 let r = v. get_item_by_slice( vm, slice) ?;
278278 let array = PyArray :: from( ArrayContentType :: $n( r) ) ;
279- array. into_pyresult ( vm)
279+ array. to_pyresult ( vm)
280280 } ) *
281281 }
282282 }
@@ -568,11 +568,11 @@ mod array {
568568 }
569569 }
570570
571- impl IntoPyResult for WideChar {
572- fn into_pyresult ( self , vm : & VirtualMachine ) -> PyResult {
571+ impl ToPyResult for WideChar {
572+ fn to_pyresult ( self , vm : & VirtualMachine ) -> PyResult {
573573 Ok (
574574 String :: from ( char:: try_from ( self ) . map_err ( |e| vm. new_unicode_encode_error ( e) ) ?)
575- . into_pyobject ( vm) ,
575+ . to_pyobject ( vm) ,
576576 )
577577 }
578578 }
@@ -1139,7 +1139,7 @@ mod array {
11391139 let typecode = vm. ctx . new_str ( array. typecode_str ( ) ) ;
11401140 let values = if array. typecode ( ) == 'u' {
11411141 let s = Self :: _wchar_bytes_to_string ( array. get_bytes ( ) , array. itemsize ( ) , vm) ?;
1142- s. chars ( ) . map ( |x| x. into_pyobject ( vm) ) . collect ( )
1142+ s. chars ( ) . map ( |x| x. to_pyobject ( vm) ) . collect ( )
11431143 } else {
11441144 array. get_objects ( vm)
11451145 } ;
@@ -1472,15 +1472,15 @@ mod array {
14721472 }
14731473 } } ;
14741474 ( $VM: ident, $BYTE: ident, $TY: ty, $BIG_ENDIAN: ident) => {
1475- chunk_to_obj!( $BYTE, $TY, $BIG_ENDIAN) . into_pyobject ( $VM)
1475+ chunk_to_obj!( $BYTE, $TY, $BIG_ENDIAN) . to_pyobject ( $VM)
14761476 } ;
14771477 ( $VM: ident, $BYTE: ident, $SIGNED_TY: ty, $UNSIGNED_TY: ty, $SIGNED: ident, $BIG_ENDIAN: ident) => { {
14781478 let b = <[ u8 ; :: std:: mem:: size_of:: <$SIGNED_TY>( ) ] >:: try_from( $BYTE) . unwrap( ) ;
14791479 match ( $SIGNED, $BIG_ENDIAN) {
1480- ( false , false ) => <$UNSIGNED_TY>:: from_le_bytes( b) . into_pyobject ( $VM) ,
1481- ( false , true ) => <$UNSIGNED_TY>:: from_be_bytes( b) . into_pyobject ( $VM) ,
1482- ( true , false ) => <$SIGNED_TY>:: from_le_bytes( b) . into_pyobject ( $VM) ,
1483- ( true , true ) => <$SIGNED_TY>:: from_be_bytes( b) . into_pyobject ( $VM) ,
1480+ ( false , false ) => <$UNSIGNED_TY>:: from_le_bytes( b) . to_pyobject ( $VM) ,
1481+ ( false , true ) => <$UNSIGNED_TY>:: from_be_bytes( b) . to_pyobject ( $VM) ,
1482+ ( true , false ) => <$SIGNED_TY>:: from_le_bytes( b) . to_pyobject ( $VM) ,
1483+ ( true , true ) => <$SIGNED_TY>:: from_be_bytes( b) . to_pyobject ( $VM) ,
14841484 }
14851485 } } ;
14861486 }
0 commit comments