Closed StuartHadfield closed 2 years ago
FWIW I have deserialised the file with Python and all is well, it produces the results I'd expect, so I'm pretty sure the data file is not the issue here.
import msgpack
fh = open('src/data.msgpack', 'rb')
fh.seek(0)
unp = msgpack.Unpacker(fh, raw=False)
for unpacker in unp:
print(unpacker)
Returns lots of data (which regrettably I cannot share)
Hmmm, okay, using a second file and things actually read out fine. Ignore me for now, apologies
Hello! Looking for some help with reading files in Rust. Super new to the language.
I have a msgpack file full of data, and I'm trying to convert it into json. I've looked at the serde / rmp_serde crates and come up with the following:
My understanding is that I've opened an I/O stream to the msgpack file, deserialised it from this io stream (https://docs.rs/rmp-serde/latest/rmp_serde/decode/fn.from_read.html) and serialized it into stdout with the serde_json serialiser.
The kicker is.... My output is just... "-17" 😳 What am I doing wrong?