File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -93,17 +93,18 @@ async fn main() {
93
93
}. into_query (" weather" ),
94
94
);
95
95
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
+ }
100
100
101
101
// Let's see if the data we wrote is there
102
102
let read_query = ReadQuery :: new (" SELECT * FROM weather" );
103
103
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
+ }
107
108
}
108
109
```
109
110
You can’t perform that action at this time.
0 commit comments