@@ -9,7 +9,7 @@ use crate::{AppCode, AppError, AppErrorKind, ProblemJson};
99fn new_sets_status_code_and_message ( ) {
1010 let e = ErrorResponse :: new ( 404 , AppCode :: NotFound , "missing" ) . expect ( "status" ) ;
1111 assert_eq ! ( e. status, 404 ) ;
12- assert ! ( matches! ( e. code, AppCode :: NotFound ) ) ;
12+ assert_eq ! ( e. code, AppCode :: NotFound ) ;
1313 assert_eq ! ( e. message, "missing" ) ;
1414 assert ! ( e. retry. is_none( ) ) ;
1515 assert ! ( e. www_authenticate. is_none( ) ) ;
@@ -246,7 +246,7 @@ fn from_app_error_preserves_status_and_sets_code() {
246246 let app = AppError :: new ( AppErrorKind :: NotFound , "user" ) ;
247247 let e: ErrorResponse = ( & app) . into ( ) ;
248248 assert_eq ! ( e. status, 404 ) ;
249- assert ! ( matches! ( e. code, AppCode :: NotFound ) ) ;
249+ assert_eq ! ( e. code, AppCode :: NotFound ) ;
250250 assert_eq ! ( e. message, "user" ) ;
251251 assert ! ( e. retry. is_none( ) ) ;
252252}
@@ -256,7 +256,7 @@ fn from_app_error_uses_default_message_when_none() {
256256 let app = AppError :: bare ( AppErrorKind :: Internal ) ;
257257 let e: ErrorResponse = ( & app) . into ( ) ;
258258 assert_eq ! ( e. status, 500 ) ;
259- assert ! ( matches! ( e. code, AppCode :: Internal ) ) ;
259+ assert_eq ! ( e. code, AppCode :: Internal ) ;
260260 assert_eq ! ( e. message, AppErrorKind :: Internal . label( ) ) ;
261261}
262262
@@ -269,7 +269,7 @@ fn from_owned_app_error_moves_message_and_metadata() {
269269 let resp: ErrorResponse = err. into ( ) ;
270270
271271 assert_eq ! ( resp. status, 401 ) ;
272- assert ! ( matches! ( resp. code, AppCode :: Unauthorized ) ) ;
272+ assert_eq ! ( resp. code, AppCode :: Unauthorized ) ;
273273 assert_eq ! ( resp. message, "owned message" ) ;
274274 assert_eq ! ( resp. retry. unwrap( ) . after_seconds, 5 ) ;
275275 assert_eq ! ( resp. www_authenticate. as_deref( ) , Some ( "Bearer" ) ) ;
@@ -280,7 +280,7 @@ fn from_owned_app_error_defaults_message_when_absent() {
280280 let resp: ErrorResponse = AppError :: bare ( AppErrorKind :: Internal ) . into ( ) ;
281281
282282 assert_eq ! ( resp. status, 500 ) ;
283- assert ! ( matches! ( resp. code, AppCode :: Internal ) ) ;
283+ assert_eq ! ( resp. code, AppCode :: Internal ) ;
284284 assert_eq ! ( resp. message, AppErrorKind :: Internal . label( ) ) ;
285285}
286286
@@ -290,7 +290,7 @@ fn from_app_error_bare_uses_kind_display_as_message() {
290290 let resp: ErrorResponse = app. into ( ) ;
291291
292292 assert_eq ! ( resp. status, 504 ) ;
293- assert ! ( matches! ( resp. code, AppCode :: Timeout ) ) ;
293+ assert_eq ! ( resp. code, AppCode :: Timeout ) ;
294294 assert_eq ! ( resp. message, AppErrorKind :: Timeout . label( ) ) ;
295295}
296296
@@ -367,7 +367,7 @@ fn display_is_concise_and_does_not_leak_details() {
367367fn new_legacy_defaults_to_internal_code ( ) {
368368 let e = ErrorResponse :: new_legacy ( 404 , "boom" ) ;
369369 assert_eq ! ( e. status, 404 ) ;
370- assert ! ( matches! ( e. code, AppCode :: Internal ) ) ;
370+ assert_eq ! ( e. code, AppCode :: Internal ) ;
371371 assert_eq ! ( e. message, "boom" ) ;
372372}
373373
@@ -376,7 +376,7 @@ fn new_legacy_defaults_to_internal_code() {
376376fn new_legacy_invalid_status_falls_back_to_internal_error ( ) {
377377 let e = ErrorResponse :: new_legacy ( 0 , "boom" ) ;
378378 assert_eq ! ( e. status, 500 ) ;
379- assert ! ( matches! ( e. code, AppCode :: Internal ) ) ;
379+ assert_eq ! ( e. code, AppCode :: Internal ) ;
380380 assert_eq ! ( e. message, "boom" ) ;
381381}
382382
0 commit comments