Skip to content

Serializing None doesn't remove the key/value from the registry #76

@gentoo90

Description

@gentoo90
let v1 = Rectangle {
    coords: Some(Coords { x: 55, y: 77 }),
    size: Size { w: 500, h: 300 },
};
key.encode(&v1).unwrap();

let v2 = Rectangle {
    coords: None,
    size: Size { w: 500, h: 300 },
};
key.encode(&v2).unwrap();

let v3: Rectangle = key.decode().unwrap();
assert_eq!(v3, v2); 
assertion `left == right` failed
  left: Rectangle { coords: Some(Coords { x: 55, y: 77 }), size: Size { w: 500, h: 300 } }
 right: Rectangle { coords: None, size: Size { w: 500, h: 300 } }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions