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

Re-export num-integer traits #190

Open
tcharding opened this issue Feb 4, 2021 · 3 comments
Open

Re-export num-integer traits #190

tcharding opened this issue Feb 4, 2021 · 3 comments

Comments

@tcharding
Copy link

For users of this library to use div_rem they must add the num-integer dependency to their project. It would be more ergonomic if num-bigint re-exported this trait so users could use use num_bigint::{BigInt, Integer}; instead.

@jvdsn
Copy link

jvdsn commented Feb 25, 2022

I have the same issue, but with the num-traits crate. Are we supposed to manually add num-traits as a dependency to our crate?

@cuviper
Copy link
Member

cuviper commented Feb 25, 2022

I think the better solution for those that don't actually care about the traits is to add corresponding inherent methods, even though that's more tedious to implement methods in two places.

@jvdsn
Copy link

jvdsn commented Feb 25, 2022

I think the better solution for those that don't actually care about the traits is to add corresponding inherent methods, even though that's more tedious to implement methods in two places.

I personally want to use methods like is_zero or is_one on big integers. I don't really care where the method is implemented, and I don't really care about useing stuff. However, I don't like that I have to explicitly add the num-traits crate as a dependency because I don't use it for anything else. So now I have to make sure the num-traits version stays compatible with the num-bigint version.

For what it's worth, I'm quite new to Rust and I was very surprised I had to explicitly add an extra dependency just for basic methods like is_zero or is_one to work. I did not expect this from the number one "bignum" Rust crate, but maybe I'm missing something.

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

3 participants