@@ -434,7 +434,7 @@ impl StatusCode {
434434 /// continuing process.
435435 pub fn is_informational ( & self ) -> bool {
436436 let num: u16 = self . clone ( ) . into ( ) ;
437- num >= 100 && num < 200
437+ ( 100 .. 200 ) . contains ( & num)
438438 }
439439
440440 /// Returns `true` if the status code is the `2xx` range.
@@ -443,7 +443,7 @@ impl StatusCode {
443443 /// received, understood, and accepted.
444444 pub fn is_success ( & self ) -> bool {
445445 let num: u16 = self . clone ( ) . into ( ) ;
446- num >= 200 && num < 300
446+ ( 200 .. 300 ) . contains ( & num)
447447 }
448448
449449 /// Returns `true` if the status code is the `3xx` range.
@@ -452,7 +452,7 @@ impl StatusCode {
452452 /// taken in order to complete the request.
453453 pub fn is_redirection ( & self ) -> bool {
454454 let num: u16 = self . clone ( ) . into ( ) ;
455- num >= 300 && num < 400
455+ ( 300 .. 400 ) . contains ( & num)
456456 }
457457
458458 /// Returns `true` if the status code is the `4xx` range.
@@ -461,7 +461,7 @@ impl StatusCode {
461461 /// or cannot be fulfilled.
462462 pub fn is_client_error ( & self ) -> bool {
463463 let num: u16 = self . clone ( ) . into ( ) ;
464- num >= 400 && num < 500
464+ ( 400 .. 500 ) . contains ( & num)
465465 }
466466
467467 /// Returns `true` if the status code is the `5xx` range.
@@ -470,7 +470,7 @@ impl StatusCode {
470470 /// apparently valid request.
471471 pub fn is_server_error ( & self ) -> bool {
472472 let num: u16 = self . clone ( ) . into ( ) ;
473- num >= 500 && num < 600
473+ ( 500 .. 600 ) . contains ( & num)
474474 }
475475
476476 /// The canonical reason for a given status code
0 commit comments