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

Add num_traits Signed to prelude #450

Merged
merged 1 commit into from
Dec 20, 2021
Merged

Conversation

jracollins
Copy link
Contributor

First of all, thanks for the awesome crate!

Currently the .signum() method cannot be used when importing prelude without adding num-traits as a specific dependency in a downstream crate and importing manually.

Other used num_traits traits are currently reexported under the prelude module so I think this tiny change to align makes sense?

Example error message when trying to use currently:

error[E0599]: no method named `signum` found for struct `rust_decimal::Decimal` in the current scope
   --> mycode/mod.rs:465:88
    |
465 |             myvalue.signum();
    |                     ^^^^^^ method not found in `rust_decimal::Decimal`
    |
   ::: /home/james/.cargo/registry/src/github.com-1ecc6299db9ec823/num-traits-0.2.14/src/sign.rs:35:8
    |
35  |     fn signum(&self) -> Self;
    |        ------ the method is available for `rust_decimal::Decimal` here
    |
    = help: items from traits can only be used if the trait is in scope
help: the following trait is implemented but not in scope; perhaps add a `use` for it:
    |
1   | use num_traits::sign::Signed;```

@paupino
Copy link
Owner

paupino commented Dec 20, 2021

Looks good to me. Thank you for your help and support!

@paupino paupino merged commit 3e771d9 into paupino:master Dec 20, 2021
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

Successfully merging this pull request may close these issues.

2 participants