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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Stream::last #347

Merged
9 commits merged into from Oct 16, 2019
Merged

add Stream::last #347

9 commits merged into from Oct 16, 2019

Conversation

starsheriff
Copy link
Contributor

@starsheriff starsheriff commented Oct 16, 2019

I have troubles getting the assignment to self.last working. I am not so familiar with pinning, so any hint would be appreciated 馃槵

Ref #129

Struggling with the associated type, pinning and how to move/copy
LastFuture.last.
still problems assigning the new value to self.last
src/stream/stream/last.rs Outdated Show resolved Hide resolved
@starsheriff starsheriff marked this pull request as ready for review October 16, 2019 10:11
@ghost
Copy link

ghost commented Oct 16, 2019

Looks like this just needs a cargo fmt now :)

"#]
fn last(
self,
) -> impl Future<Output = Option<Self::Item>> + '_ [LastFuture<Self, Self::Item>]
Copy link

Choose a reason for hiding this comment

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

Suggested change
) -> impl Future<Output = Option<Self::Item>> + '_ [LastFuture<Self, Self::Item>]
) -> impl Future<Output = Option<Self::Item>> [LastFuture<Self, Self::Item>]

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right, the lifetime is not needed. I got a bit lost in the type signature I guess 馃槵

Copy link

Choose a reason for hiding this comment

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

No worries, thanks! :)

"#]
fn last(
self,
) -> impl Future<Output = Option<Self::Item>> + 'static [LastFuture<Self, Self::Item>]
Copy link

Choose a reason for hiding this comment

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

The + 'static is not necessary (doesn't have an effect in this context) and we don't use it other similar methods :)

Suggested change
) -> impl Future<Output = Option<Self::Item>> + 'static [LastFuture<Self, Self::Item>]
) -> impl Future<Output = Option<Self::Item>> [LastFuture<Self, Self::Item>]

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

Perfect, thank you! :)

@ghost ghost merged commit aaa1b6c into async-rs:master Oct 16, 2019
This pull request was closed.
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.

None yet

2 participants