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

Murisi/generic unextended checked traits #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

murisi
Copy link
Collaborator

@murisi murisi commented May 20, 2024

Adjusted num-traits so that the checked traits are now generic and so that they do not depend on their unchecked equivalents. Given the new use of generic, the traits are now defined for both reference and value types.

type Output = $t;
#[inline]
fn $method(self, v: &$t) -> Option<$t> {
<$t>::$method(self, *v)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't this force the $t to be Copy?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess that assumption was already present in the existing code. I see it used below

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, it's fine to assume we only care about copyable types I think

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.

3 participants