Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document features #71

Open
maxbla opened this issue Mar 13, 2020 · 3 comments
Open

Document features #71

maxbla opened this issue Mar 13, 2020 · 3 comments

Comments

@maxbla
Copy link
Contributor

maxbla commented Mar 13, 2020

This crate makes use of features so that "you don't pay for what you don't use" and to support no_std while allowing for extensions that require the standard library. This is good, but it can be beginner unfriendly. The readme should include a brief overview of the features this crate provides with a beginner friendly presentation.

@cuviper
Copy link
Member

cuviper commented Mar 13, 2020

Sure, would you like to write that up? The current features are:

  • std enables the full standard library (on by default)
  • bigint-std enables BigRational using std (on by default)
  • bigint enables BigRational using just core and alloc (requires Rust 1.36+)
  • serde implements Deserialize and Serialize for Ratio<T>

Technically, cargo will accept num-bigint as a feature here too for the optional dependency, but it doesn't actually enable anything in num-rational. I'm now thinking we should simplify that one -- package renaming can let us have just bigint and our added bigint-std, or we can go the other way to full num-bigint and add explicit num-bigint-std instead. Thoughts?

@ghost
Copy link

ghost commented Aug 6, 2021

I ran into this myself. I started writing a custom serializer for a Rational type and then realized that it already existed. But I could find no mention of the serde feature anywhere (except by reading the code). Do you want me to submit a PR for a change to the docs?

@cuviper
Copy link
Member

cuviper commented Aug 28, 2021

Sure, a PR to improve docs would be welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants