Skip to content

Allow deserializing empty compound tags in deserialize_any#67

Open
Iaiao wants to merge 2 commits into
PistonDevelopers:masterfrom
Iaiao:patch-1
Open

Allow deserializing empty compound tags in deserialize_any#67
Iaiao wants to merge 2 commits into
PistonDevelopers:masterfrom
Iaiao:patch-1

Conversation

@Iaiao

@Iaiao Iaiao commented Dec 30, 2021

Copy link
Copy Markdown
Contributor

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