Giter Site home page Giter Site logo

Comments (4)

dnsl48 avatar dnsl48 commented on July 29, 2024

Hi @scott-wilson, thank you for your feedback and for the suggestion!
Yes, indeed, we don't have support for "1/2", although that feels rather trivial to split in two integers and, perhaps, might even use Rust own built-in string to integer parsing capabilities.
Nonetheless, it might be nice to have a shortcut for that in the library API, especially that it is the format we produce via Display. If you have an interest in providing a PR for that, that would be appreciated!

using nom for parsing the string

Yes, nom is a powerful tool. We only have rather trivial parsing in this crate, so I don't feel a strong need to use it, but if you provided the implementation in your PRs, that would be nice (ideally a separate PR with refactoring and a separate one for parsing "1/2"). For the refactored code I would appreciate having a benchmark as well, to make sure we don't have a performance regression.

from fraction.

scott-wilson avatar scott-wilson commented on July 29, 2024

Sounds good. I'll take a crack at it and see how it benchmarks.

from fraction.

dnsl48 avatar dnsl48 commented on July 29, 2024

Thank you for the contribution!
Released in 0.10.0.

P.S.
Regarding refactoring that with nom it feels like it might not be worth pulling nom to only cover our existing parsing needs. Having nom as a hard dependency could cause version conflicts with external projects' own nom.
Feels like maybe the benefits won't outweigh the downsides in that case.
Closing this issue for now, but please reopen if you'd like to keep that discussion going :)

from fraction.

scott-wilson avatar scott-wilson commented on July 29, 2024

Yeah, I feel like you're right. Thanks for the merge!

from fraction.

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.