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
add Stream::last #347
Conversation
Struggling with the associated type, pinning and how to move/copy LastFuture.last.
still problems assigning the new value to self.last
Looks like this just needs a |
src/stream/stream/mod.rs
Outdated
"#] | ||
fn last( | ||
self, | ||
) -> impl Future<Output = Option<Self::Item>> + '_ [LastFuture<Self, Self::Item>] |
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.
) -> impl Future<Output = Option<Self::Item>> + '_ [LastFuture<Self, Self::Item>] | |
) -> impl Future<Output = Option<Self::Item>> [LastFuture<Self, Self::Item>] |
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.
right, the lifetime is not needed. I got a bit lost in the type signature I guess 馃槵
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.
No worries, thanks! :)
src/stream/stream/mod.rs
Outdated
"#] | ||
fn last( | ||
self, | ||
) -> impl Future<Output = Option<Self::Item>> + 'static [LastFuture<Self, Self::Item>] |
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.
The + 'static
is not necessary (doesn't have an effect in this context) and we don't use it other similar methods :)
) -> impl Future<Output = Option<Self::Item>> + 'static [LastFuture<Self, Self::Item>] | |
) -> impl Future<Output = Option<Self::Item>> [LastFuture<Self, Self::Item>] |
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.
Perfect, thank you! :)
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