Closed dzil123 closed 2 years ago
Hi, thats a pretty big issue. Thanks for taking the time to come up with test cases.
I'll add these to the unit tests (I'm surprised I didn't already have something along these lines) and work in a fix when I get a chance.
Thanks again!
Hi again, this turns out to be a reasonably deep issue. It is related to serde-rs#2198. For tuples and arrays the next_seed
function isn't called a last time.
Fixing it will be a bit of effort that I don't have right now. A workaround is to use Vec
for these like you have already shown, rather than a tuple. Sorry about that!
Fixed in fastnbt 2.3.0! Ended up rewriting the majority of the crate!
Affects fastnbt v2.2.0 and
eb36aa3
.Normally, an NBT List of ints, len=3 can be deserialized into a tuple of
(i32, i32, i32)
, an array of[i32; 3]
, or aVec<i32>
. However, nesting this list in a list of compounds causes deserialization into a tuple or array to fail with the error message "expected to be in list, but was in compound Some(List)".In this example code, I expect all test cases to pass:
Output: