-
Notifications
You must be signed in to change notification settings - Fork 20
Change in order of assert after write causes move error #4
Copy link
Copy link
Closed
Description
It appears that the change in 5aaf53f now produces the following build error
error[E0382]: borrow of moved value: `dataset`
--> src/koans/02_cluster_generation/06_dataset.rs:96:17
|
80 | let dataset = generate_dataset(n, centroids.view(), &mut rng);
| ------- move occurs because `dataset` has type `ndarray::ArrayBase<ndarray::OwnedRepr<f64>, ndarray::dimension::dim::Dim<[usize; 2]>>`, which does not implement the `Copy` trait
...
90 | write_npy("python/dataset.npy", dataset).expect("Failed to write array in npy format.");
| ------- value moved here
...
96 | assert!(dataset.genrows().into_iter().all(|r| r != array![0., 0.]));
| ^^^^^^^ value borrowed here after move
error: aborting due to previous error
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels