File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -93,17 +93,18 @@ async fn main() {
9393 }. into_query (" weather" ),
9494 );
9595
96- let write_result = client
97- . query ( weather_readings )
98- . await ;
99- assert! ( write_result . is_ok (), " Write result was not okay " );
96+ if let Err ( e ) = client . query ( weather_readings ) . await {
97+ println! ( " Error writing result: {e} " );
98+ return ;
99+ }
100100
101101 // Let's see if the data we wrote is there
102102 let read_query = ReadQuery :: new (" SELECT * FROM weather" );
103103
104- let read_result = client . query (read_query ). await ;
105- assert! (read_result . is_ok (), " Read result was not ok" );
106- println! (" {}" , read_result . unwrap ());
104+ match client . query (read_query ). await {
105+ Ok (read_result ) => println! (" {}" , read_result ),
106+ Err (e ) => println! (" Error reading result: {e}" ),
107+ }
107108}
108109```
109110
You can’t perform that action at this time.
0 commit comments