-
Notifications
You must be signed in to change notification settings - Fork 313
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 all_equal #196
Add all_equal #196
Conversation
src/lib.rs
Outdated
/// let data : Option<usize> = None; | ||
/// assert!(data.into_iter().all_equal()); | ||
/// ``` | ||
fn all_equal(self) -> bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, it's not always easy to decide, but I think this method should use &mut self
and no Self: Sized
, just like all
. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By the way, the method should be sorted among the methods, not the adaptors, so it needs to be moved down. next_tuple is the first non-adaptor in the trait.
I think we could use |
That's a good extension. But we need to find a new name of it then! Hehe, I think of a good feature as being a combination of a natural name and a wanted functionality. We need both for it to be used. |
I re-checked with I think the travis failure is related to rust-lang/rustup#1062. |
Great, thank you! |
This refers to #175. I think going with
dedup
is a convenient, simple solution.