Skip to content

Conversation

Iaiao
Copy link
Contributor

@Iaiao Iaiao commented Dec 30, 2021

Now it returns an error in deserialize_map if the tag is not 0x0A instead of just returning an error in deserialize_any.

let empty = nbt::Value::Compound(HashMap::new());
let mut serialized = Vec::new();
nbt::to_writer(&mut serialized, &empty, None).unwrap();
assert_eq!(serialized, vec![0x0A, 0x00, 0x00, 0x00]);
let should_work: nbt::Value = nbt::from_reader(Cursor::new(serialized)).unwrap(); // Error::NoRootCompound

@Iaiao Iaiao changed the title Make it deserialize compounds in deserialize_any Allow deserializing empty compound tags in deserialize_any Dec 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant