Skip to content

Conversation

@Kimundi
Copy link
Contributor

@Kimundi Kimundi commented Feb 15, 2013

Moved them into own module and made them not depend on an Round trait impl for integers and generic math functions that can fail on integers any more.

@catamorphism
Copy link
Contributor

Looks good except for those predicates that seem to be unnecessary as required trait methods. If you remove those (or tell me the reason I've overlooked that they need to be in the trait) I'll approve it -- thanks!

@Kimundi
Copy link
Contributor Author

Kimundi commented Feb 15, 2013

The idea was to be able to both query if a type supports one of the special values, and if yes, whether a value of the type is equal to one of them.

But looking over it again, the has_* functions could get removed althogether, with is_* returning false taking on the double meaning 'no/does not apply'. And those could simply be standalone functions, yes. I'm gonna make the necessary changes. (Though ideally the trait would become an private implementation detail anyway, but yeah no reason for it to be needlessly complex)

Moved `is_*` predicates into standalone functions
@catamorphism
Copy link
Contributor

Thanks!

bors added a commit that referenced this pull request Feb 16, 2013
Moved them into own module and made them not depend on an Round trait impl for integers and generic math functions that can fail on integers any more.
@bors bors closed this Feb 16, 2013
bors added a commit to rust-lang-ci/rust that referenced this pull request May 2, 2020
New Lint: Iter nth zero

Check for the use of `iter.nth(0)` and encourage `iter.next()` instead as it is more readable

changelog: add new lint when `iter.nth(0)` is used

Fixes rust-lang#4957
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