@@ -676,9 +676,9 @@ impl<T: Element, D: Dimension> PyArray<T, D> {
676676 /// assert_eq!(pyarray.readonly().as_array(), array![[1, 2], [3, 4]]);
677677 /// });
678678 /// ```
679- pub fn from_owned_array < ' py > ( py : Python < ' py > , arr : Array < T , D > ) -> & ' py Self {
679+ pub fn from_owned_array < ' py > ( py : Python < ' py > , mut arr : Array < T , D > ) -> & ' py Self {
680680 let ( strides, dims) = ( arr. npy_strides ( ) , arr. raw_dim ( ) ) ;
681- let data_ptr = arr. as_ptr ( ) ;
681+ let data_ptr = arr. as_mut_ptr ( ) ;
682682 unsafe { Self :: from_raw_parts ( py, dims, strides. as_ptr ( ) , data_ptr, arr) }
683683 }
684684
@@ -1071,9 +1071,9 @@ impl<D: Dimension> PyArray<PyObject, D> {
10711071 /// assert!(pyarray.readonly().as_array().get(0).unwrap().as_ref(py).is_instance_of::<CustomElement>().unwrap());
10721072 /// });
10731073 /// ```
1074- pub fn from_owned_object_array < ' py , T > ( py : Python < ' py > , arr : Array < Py < T > , D > ) -> & ' py Self {
1074+ pub fn from_owned_object_array < ' py , T > ( py : Python < ' py > , mut arr : Array < Py < T > , D > ) -> & ' py Self {
10751075 let ( strides, dims) = ( arr. npy_strides ( ) , arr. raw_dim ( ) ) ;
1076- let data_ptr = arr. as_ptr ( ) as * const PyObject ;
1076+ let data_ptr = arr. as_mut_ptr ( ) as * const PyObject ;
10771077 unsafe { PyArray :: from_raw_parts ( py, dims, strides. as_ptr ( ) , data_ptr, arr) }
10781078 }
10791079}
0 commit comments