Skip to content

Commit d342c21

Browse files
committed
cargo clippy --fix
1 parent bcfca5a commit d342c21

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/conditional/etag.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ impl ETag {
117117

118118
if !s
119119
.bytes()
120-
.all(|c| c == 0x21 || (c >= 0x23 && c <= 0x7E) || c >= 0x80)
120+
.all(|c| c == 0x21 || (0x23..=0x7E).contains(&c) || c >= 0x80)
121121
{
122122
return Err(Error::from_str(
123123
StatusCode::BadRequest,

src/status_code.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)