Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let serial = serde_json::to_string(&a).unwrap();
- let mut f = BufWriter::new(File::create("/tmp/foo.bar").unwrap());
- serialize_into(&mut f, &a).unwrap();
- let f = File::open("/tmp/foo.bar").unwrap();
- let mut rdr = BufReader::new(f);
- let decoded: ndarray::ArrayBase<ndarray::OwnedRepr<f32>, ndarray::Dim<[usize; 1]>> = deserialize_from(&mut rdr).unwrap();
- // thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Io(Custom { kind: UnexpectedEof, error: StringError("failed to fill whole buffer") })', src/libcore/result.rs:997:5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement