Stream::last() has hidden requirement that the item type be Copy
Open
- Dominant language
- Rust
- Stars
- 4.1k
- Forks
- 339
- PR merge metrics
- No merged PRs in 30d
Description
The `Future` type returned by `Stream::last()` requires that the item type be `Copy` but this is not documented anywhere: https://github.com/async-rs/async-std/blob/b446cd023084a157b8a531cff65b8df37750be58/src/stream/stream/last.rs#L25-L29
This looks to be an implementation mistake because copying `this.last` should not be necessary here and `this.last.take()` can be used instead: https://github.com/async-rs/async-std/blob/b446cd023084a157b8a531cff65b8df37750be58/src/stream/stream/last.rs#L42
cc https://github.com/launchbadge/sqlx/issues/277
Contributor guide
Assessment
This issue has not been assessed yet.