We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8481527 commit de0278aCopy full SHA for de0278a
src/array.rs
@@ -308,7 +308,10 @@ impl Array {
308
}
309
310
/// Copies the data from the Array to the mutable slice `data`
311
- pub fn host<T>(&self, data: &mut [T]) {
+ pub fn host<T: HasAfEnum>(&self, data: &mut [T]) {
312
+ if data.len() != self.elements() {
313
+ HANDLE_ERROR(AfError::ERR_SIZE);
314
+ }
315
unsafe {
316
let err_val = af_get_data_ptr(data.as_mut_ptr() as *mut c_void, self.handle as AfArray);
317
HANDLE_ERROR(AfError::from(err_val));
0 commit comments