Skip to content

Commit db1a1a3

Browse files
JRRudy1davidhewitt
authored andcommitted
Updated ToPyArray impls to call py_clone instead of clone.
1 parent f291cf2 commit db1a1a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/convert.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ where
195195
let array = PyArray::<A, _>::new_bound(py, dim, false);
196196
let mut data_ptr = array.data();
197197
for item in self.iter() {
198-
data_ptr.write(item.clone());
198+
data_ptr.write(item.py_clone(py));
199199
data_ptr = data_ptr.add(1);
200200
}
201201
array
@@ -228,7 +228,7 @@ where
228228
ptr::copy_nonoverlapping(self.data.ptr(), data_ptr, self.len());
229229
} else {
230230
for item in self.iter() {
231-
data_ptr.write(item.clone());
231+
data_ptr.write(item.py_clone(py));
232232
data_ptr = data_ptr.add(1);
233233
}
234234
}

0 commit comments

Comments
 (0)