Remove expects from demo
This commit is contained in:
parent
3f54e911ea
commit
deef31ba2d
|
@ -1,7 +1,7 @@
|
|||
use std::time::Duration;
|
||||
use tracing_subscriber::{fmt, prelude::*, EnvFilter};
|
||||
|
||||
fn main() {
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
tracing_subscriber::registry()
|
||||
.with(fmt::layer())
|
||||
.with(EnvFilter::from_default_env())
|
||||
|
@ -11,8 +11,7 @@ fn main() {
|
|||
.min_threads(1)
|
||||
.max_threads(10)
|
||||
.buffer_multiplier(8)
|
||||
.build()
|
||||
.expect("Valid configuration");
|
||||
.build()?;
|
||||
|
||||
smol::block_on(async {
|
||||
// scale up
|
||||
|
@ -37,7 +36,7 @@ fn main() {
|
|||
.collect();
|
||||
|
||||
for task in tasks {
|
||||
let i = task.await.expect("Got value");
|
||||
let i = task.await?;
|
||||
tracing::info!("Awaited {i}");
|
||||
}
|
||||
|
||||
|
@ -46,10 +45,10 @@ fn main() {
|
|||
pool.spawn(move || {
|
||||
std::thread::sleep(Duration::from_millis(400));
|
||||
})
|
||||
.await
|
||||
.expect("Got value");
|
||||
.await?;
|
||||
}
|
||||
|
||||
assert!(pool.close().await);
|
||||
Ok(())
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue