Git Product home page Git Product logo

Comments (3)

toby avatar toby commented on September 24, 2024 1

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.

angusturner avatar angusturner commented on September 24, 2024

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.

toby avatar toby commented on September 24, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.