You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When serde-diff calls unwrap() this will throw an error. Though with bincode it won't panic.
use serde_diff::{Apply,Diff,SerdeDiff,FieldPathMode,Config};use serde::{Serialize,Deserialize};#[derive(SerdeDiff,Serialize,Deserialize,PartialEq,Debug)]structTestStruct{a:u32,b:f64,}fnmain(){let old = TestStruct{a:5,b:2.,};let new = TestStruct{a:8,// Differs from old.a, will be serializedb:2.,};let diff = Config::new().with_field_path_mode(FieldPathMode::Index).serializable_diff(&old,&new);let msgpack_data = rmp_serde::to_vec(&diff).unwrap();// let bincode_data = bincode::serialize(&diff).unwrap();}
The text was updated successfully, but these errors were encountered:
I use rmp-serde crate for serialisation. When I perform the difference serialisation I get the error
If a
None
value is passed toserialized_seq
rmp-serde throws this error. See:https://github.com/3Hren/msgpack-rust/blob/master/rmp-serde/src/encode.rs#L516
This is what
serde-diff
does:https://github.com/amethyst/serde-diff/blob/master/src/lib.rs#L403
When
serde-diff
callsunwrap()
this will throw an error. Though withbincode
it won't panic.The text was updated successfully, but these errors were encountered: