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

Functions for oldest to newest iterator #3

Merged
merged 2 commits into from
Jan 9, 2020
Merged

Functions for oldest to newest iterator #3

merged 2 commits into from
Jan 9, 2020

Conversation

valmirjunior0088
Copy link
Contributor

@valmirjunior0088 valmirjunior0088 commented Jan 8, 2020

Closes #2.

I tried my best to follow your current philosophy for the project, but perhaps I might need some help writing the tests.

Copy link
Owner

@YaLTeR YaLTeR left a comment

Choose a reason for hiding this comment

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

All good apart from the change, but I'm not sure I like the name "incremental", it sounds like a different concept. That said, I can't quite come up with a good name either, so let's leave this as is.

src/lib.rs Outdated
/// assert_eq!(iter.next(), Some(&4));
/// ```
#[inline]
pub fn incr_iter(&mut self) -> IncrIter<T> {
Copy link
Owner

Choose a reason for hiding this comment

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

Suggested change
pub fn incr_iter(&mut self) -> IncrIter<T> {
pub fn incr_iter(&self) -> IncrIter<T> {

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 9, 2020

The CI failure is due to rust-lang/rust#67408.

@valmirjunior0088
Copy link
Contributor Author

Perhaps 'ascending' transmits a meaning that more closely resembles our objective.

Regarding the CI failure, I'm not exactly sure how I would go about fixing it.

@valmirjunior0088
Copy link
Contributor Author

Small curiosity: you added the #[inline] annotation to every method of the structure, but not the .push() method. Is there some reason?

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 9, 2020

Small curiosity: you added the #[inline] annotation to every method of the structure, but not the .push() method. Is there some reason?

Not that I can recall. Probably forgot about it. ¯\_(ツ)_/¯

@valmirjunior0088
Copy link
Contributor Author

valmirjunior0088 commented Jan 9, 2020

I've took the liberty of adding it.

Regarding the entire PR, I believe this is enough functionality. Can we merge?

@YaLTeR
Copy link
Owner

YaLTeR commented Jan 9, 2020

Yes, great! Do you mind squashing it into two commits, one adding the missing #[inline] on push and another adding the iterators?

Valmir Pretto added 2 commits January 9, 2020 09:35
Remove unnecessary mutability

Change names
Add missing #[inline] annotation
@valmirjunior0088
Copy link
Contributor Author

Done.

@YaLTeR YaLTeR merged commit 6295494 into YaLTeR:master Jan 9, 2020
@YaLTeR
Copy link
Owner

YaLTeR commented Jan 9, 2020

Thanks!

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.

Iterator direction
2 participants