mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-26 00:00:16 +02:00
13 lines
303 B
Rust
13 lines
303 B
Rust
use tokio::stream::{self, Stream, StreamExt};
|
|
|
|
#[tokio::test]
|
|
async fn basic_usage() {
|
|
let mut one = stream::once(1);
|
|
|
|
assert_eq!(one.size_hint(), (1, Some(1)));
|
|
assert_eq!(Some(1), one.next().await);
|
|
|
|
assert_eq!(one.size_hint(), (0, Some(0)));
|
|
assert_eq!(None, one.next().await);
|
|
}
|