@@ -430,7 +430,7 @@ impl<T: Element, D: Dimension> PyArray<T, D> {
430
430
let dims = dims. into_dimension ( ) ;
431
431
let ptr = PY_ARRAY_API . PyArray_NewFromDescr (
432
432
PY_ARRAY_API . get_type_object ( npyffi:: NpyTypes :: PyArray_Type ) ,
433
- T :: get_dtype ( py) . into_ptr ( ) as _ ,
433
+ T :: get_dtype ( py) . into_dtype_ptr ( ) ,
434
434
dims. ndim_cint ( ) ,
435
435
dims. as_dims_ptr ( ) ,
436
436
strides as * mut npy_intp , // strides
@@ -454,7 +454,7 @@ impl<T: Element, D: Dimension> PyArray<T, D> {
454
454
let dims = dims. into_dimension ( ) ;
455
455
let ptr = PY_ARRAY_API . PyArray_NewFromDescr (
456
456
PY_ARRAY_API . get_type_object ( npyffi:: NpyTypes :: PyArray_Type ) ,
457
- T :: get_dtype ( py) . into_ptr ( ) as _ ,
457
+ T :: get_dtype ( py) . into_dtype_ptr ( ) ,
458
458
dims. ndim_cint ( ) ,
459
459
dims. as_dims_ptr ( ) ,
460
460
strides as * mut npy_intp , // strides
@@ -567,11 +567,10 @@ impl<T: Element, D: Dimension> PyArray<T, D> {
567
567
{
568
568
let dims = dims. into_dimension ( ) ;
569
569
unsafe {
570
- let dtype = T :: get_dtype ( py) ;
571
570
let ptr = PY_ARRAY_API . PyArray_Zeros (
572
571
dims. ndim_cint ( ) ,
573
572
dims. as_dims_ptr ( ) ,
574
- dtype . into_ptr ( ) as _ ,
573
+ T :: get_dtype ( py ) . into_dtype_ptr ( ) ,
575
574
if is_fortran { -1 } else { 0 } ,
576
575
) ;
577
576
Self :: from_owned_ptr ( py, ptr)
@@ -1102,10 +1101,9 @@ impl<T: Element, D> PyArray<T, D> {
1102
1101
/// ```
1103
1102
pub fn cast < ' py , U : Element > ( & ' py self , is_fortran : bool ) -> PyResult < & ' py PyArray < U , D > > {
1104
1103
let ptr = unsafe {
1105
- let dtype = U :: get_dtype ( self . py ( ) ) ;
1106
1104
PY_ARRAY_API . PyArray_CastToType (
1107
1105
self . as_array_ptr ( ) ,
1108
- dtype . into_ptr ( ) as _ ,
1106
+ U :: get_dtype ( self . py ( ) ) . into_dtype_ptr ( ) ,
1109
1107
if is_fortran { -1 } else { 0 } ,
1110
1108
)
1111
1109
} ;
0 commit comments