@@ -23,15 +23,20 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
2323 "blocks" => {
2424 tokio:: task:: Builder :: new ( )
2525 . name ( "blocks" )
26- . spawn ( double_sleepy ( 1 , 10 ) ) ;
26+ . spawn ( double_sleepy ( 1 , 10 ) )
27+ . unwrap ( ) ;
2728 }
2829 "coma" => {
2930 tokio:: task:: Builder :: new ( )
3031 . name ( "coma" )
31- . spawn ( std:: future:: pending :: < ( ) > ( ) ) ;
32+ . spawn ( std:: future:: pending :: < ( ) > ( ) )
33+ . unwrap ( ) ;
3234 }
3335 "burn" => {
34- tokio:: task:: Builder :: new ( ) . name ( "burn" ) . spawn ( burn ( 1 , 10 ) ) ;
36+ tokio:: task:: Builder :: new ( )
37+ . name ( "burn" )
38+ . spawn ( burn ( 1 , 10 ) )
39+ . unwrap ( ) ;
3540 }
3641 "help" | "-h" => {
3742 eprintln ! ( "{}" , HELP ) ;
@@ -47,10 +52,12 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
4752
4853 let task1 = tokio:: task:: Builder :: new ( )
4954 . name ( "task1" )
50- . spawn ( spawn_tasks ( 1 , 10 ) ) ;
55+ . spawn ( spawn_tasks ( 1 , 10 ) )
56+ . unwrap ( ) ;
5157 let task2 = tokio:: task:: Builder :: new ( )
5258 . name ( "task2" )
53- . spawn ( spawn_tasks ( 10 , 30 ) ) ;
59+ . spawn ( spawn_tasks ( 10 , 30 ) )
60+ . unwrap ( ) ;
5461
5562 let result = tokio:: try_join! {
5663 task1,
@@ -66,7 +73,10 @@ async fn spawn_tasks(min: u64, max: u64) {
6673 loop {
6774 for i in min..max {
6875 tracing:: trace!( i, "spawning wait task" ) ;
69- tokio:: task:: Builder :: new ( ) . name ( "wait" ) . spawn ( wait ( i) ) ;
76+ tokio:: task:: Builder :: new ( )
77+ . name ( "wait" )
78+ . spawn ( wait ( i) )
79+ . unwrap ( ) ;
7080
7181 let sleep = Duration :: from_secs ( max) - Duration :: from_secs ( i) ;
7282 tracing:: trace!( ?sleep, "sleeping..." ) ;
0 commit comments