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 method is_one to One trait #5

Closed
cuviper opened this issue Dec 19, 2017 · 6 comments
Closed

Add method is_one to One trait #5

cuviper opened this issue Dec 19, 2017 · 6 comments

Comments

@cuviper
Copy link
Member

cuviper commented Dec 19, 2017

From @pyfisch on August 5, 2016 17:15

The Zero trait contains two methods: zero returns the number 0 for the given type and is_zero is provided and can be used to check if a number is 0.

The One trait is similar but contains only the method one to create the number 1. Please also add a method to check if a number is one.

Copied from original issue: rust-num/num#214

@cuviper
Copy link
Member Author

cuviper commented Dec 19, 2017

Sure, I'm fine with that. It should be easy if you'd like to add that
yourself and send a PR.

@cuviper
Copy link
Member Author

cuviper commented Dec 19, 2017

It turned out not so easy without a breaking change, although we could add it where Self: PartialEq for now to allow a default implementation, and drop that in a breaking change (eventually).

@cuviper
Copy link
Member Author

cuviper commented Dec 20, 2017

That was rust-num/num#336 on the next branch.

@clarfonthey clarfonthey mentioned this issue Feb 19, 2018
bors bot added a commit that referenced this issue Feb 23, 2018
39: Add is_one. r=cuviper a=clarcharr

Implements the version recommended in #5. That issue should remain open to track the breaking-change version.
@clarfonthey
Copy link
Contributor

The issue description/title should be updated to mention removing the PartialEq bound rather than adding the function.

@vks
Copy link
Contributor

vks commented Jun 29, 2018

Shouldn't this be closed?

@cuviper
Copy link
Member Author

cuviper commented Jun 29, 2018

I added the PartialEq note to #47 for breaking changes.

@cuviper cuviper closed this as completed Jun 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants