File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -235,26 +235,24 @@ fn error_response() {
235235 )
236236 . test ( |mut db| async move {
237237 let res: Result < Vec < mysql_async:: Row > , _ > = db. query ( "SELECT a, b FROM foo" ) . await ;
238-
239- match res {
240- Ok ( _) => assert ! ( false ) ,
241- Err ( mysql_async:: Error :: Server ( mysql_async:: ServerError {
238+ match res. unwrap_err ( ) {
239+ mysql_async:: Error :: Server ( mysql_async:: ServerError {
242240 code,
243241 message : ref msg,
244242 ref state,
245- } ) ) => {
243+ } ) => {
246244 assert_eq ! (
247245 state,
248246 & String :: from_utf8( err. 0 . sqlstate( ) . to_vec( ) ) . unwrap( )
249247 ) ;
250248 assert_eq ! ( code, err. 0 as u16 ) ;
251249 assert_eq ! ( msg, & err. 1 ) ;
252250 }
253- Err ( e ) => {
251+ e => {
254252 eprintln ! ( "unexpected {:?}" , e) ;
255253 assert ! ( false ) ;
256254 }
257- }
255+ } ;
258256 Ok ( ( ) )
259257 } )
260258}
You can’t perform that action at this time.
0 commit comments