Clean up
This commit is contained in:
parent
2fd4c12a95
commit
c4b57ae813
24
src/utils.rs
24
src/utils.rs
|
@ -188,26 +188,4 @@ pub async fn print_source_until_eof<'a, R, T, F>(
|
|||
}
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
||||
pub async fn get_async_num() -> i32 {
|
||||
let millis = Uniform::from(0..10).sample(&mut rand::thread_rng());
|
||||
println!("get_async_num will complete in {} ms", millis);
|
||||
|
||||
task::sleep(Duration::from_millis(millis)).await;
|
||||
let i: i32 = rand::random();
|
||||
i
|
||||
}
|
||||
|
||||
|
||||
// pub fn get_source_stream() -> impl Stream<Item = i32> {
|
||||
// let s = stream! {
|
||||
// for i in 0..3 {
|
||||
// let x = get_async_num().await;
|
||||
// yield x;
|
||||
// }
|
||||
// };
|
||||
// s
|
||||
// }
|
||||
|
||||
}
|
Loading…
Reference in New Issue