@@ -434,7 +434,7 @@ impl StatusCode {
434
434
/// continuing process.
435
435
pub fn is_informational ( & self ) -> bool {
436
436
let num: u16 = self . clone ( ) . into ( ) ;
437
- num >= 100 && num < 200
437
+ ( 100 .. 200 ) . contains ( & num)
438
438
}
439
439
440
440
/// Returns `true` if the status code is the `2xx` range.
@@ -443,7 +443,7 @@ impl StatusCode {
443
443
/// received, understood, and accepted.
444
444
pub fn is_success ( & self ) -> bool {
445
445
let num: u16 = self . clone ( ) . into ( ) ;
446
- num >= 200 && num < 300
446
+ ( 200 .. 300 ) . contains ( & num)
447
447
}
448
448
449
449
/// Returns `true` if the status code is the `3xx` range.
@@ -452,7 +452,7 @@ impl StatusCode {
452
452
/// taken in order to complete the request.
453
453
pub fn is_redirection ( & self ) -> bool {
454
454
let num: u16 = self . clone ( ) . into ( ) ;
455
- num >= 300 && num < 400
455
+ ( 300 .. 400 ) . contains ( & num)
456
456
}
457
457
458
458
/// Returns `true` if the status code is the `4xx` range.
@@ -461,7 +461,7 @@ impl StatusCode {
461
461
/// or cannot be fulfilled.
462
462
pub fn is_client_error ( & self ) -> bool {
463
463
let num: u16 = self . clone ( ) . into ( ) ;
464
- num >= 400 && num < 500
464
+ ( 400 .. 500 ) . contains ( & num)
465
465
}
466
466
467
467
/// Returns `true` if the status code is the `5xx` range.
@@ -470,7 +470,7 @@ impl StatusCode {
470
470
/// apparently valid request.
471
471
pub fn is_server_error ( & self ) -> bool {
472
472
let num: u16 = self . clone ( ) . into ( ) ;
473
- num >= 500 && num < 600
473
+ ( 500 .. 600 ) . contains ( & num)
474
474
}
475
475
476
476
/// The canonical reason for a given status code
0 commit comments