Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow deserializing empty compound tags in deserialize_any #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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