Comments (3)
Great find. It looks like the encoder is having trouble serializing None
values in structs. I have a fix in mind and will update and do another release.
Also, just fyi -- this won't work: let info_str: String = String::from_utf8(info_ser).unwrap();
because there are non utf-8 bytes in .torrent files.
from serde-bencode.
Ah, I had a feeling that might be it. Have switched to bip_bencode for the moment, but the API feels much more cumbersome. So if will be keeping an eye on this repo for potential fix :) Also you saved me so much grief by pointing out that UTF8 thing... cheers.
from serde-bencode.
Ok I published a fix to this, so it should work now. I need to rethink how the serialization state machine works though, it's a bit messy. Serde is currently in pretty active development so I'll probably wait for it to stabilize a bit before pushing the next version.
The fix is in version serde_bencode = "0.1.2"
.
Release notes: https://github.com/toby/serde-bencode/releases/tag/v0.1.2
I also put the example code you were going for in a gist: https://gist.github.com/toby/ee1a7ce4a31057d7c838bce839b92582
from serde-bencode.
Related Issues (20)
- Bencode enum link in the readme is broken HOT 2
- Write better documentation HOT 4
- Encoding Vec<u8> as bytes HOT 3
- Fix Rust 1.26 attribute regression HOT 3
- not support complex struct?
- Error round-tripping complex struct HOT 1
- RawValue as a type for deserializing HOT 1
- Failure to deserialize into adjacently tagged enum
- OOM when parsing byte string with extremely long (incorrect) length
- ERROR: Invalid Type: sequence (expected: `bytes`) HOT 1
- Change from pub to pub(crate)
- Tuple structs cannot be deserialized
- Improve testing coverage
- Deserialization for enums with `#[serde(flatten)]` is not working HOT 1
- Update to work with Serde 0.9.X
- Release: `v0.2.4` HOT 1
- Upgrade to serde 1.0 HOT 4
- How to unwrap pieces? HOT 3
- Bytebuf with serde-bencode 0.2.0? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serde-bencode.