1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-25 14:49:20 +02:00

fix clippy warning on nightly (#2088)

* fix clippy warning on nightly
This commit is contained in:
fakeshadow
2021-03-19 04:25:35 -07:00
committed by GitHub
parent 78fcd0237a
commit 351286486c
11 changed files with 30 additions and 52 deletions

View File

@ -127,9 +127,8 @@ impl Display for EntityTag {
impl FromStr for EntityTag {
type Err = crate::error::ParseError;
fn from_str(s: &str) -> Result<EntityTag, crate::error::ParseError> {
let length: usize = s.len();
let slice = &s[..];
fn from_str(slice: &str) -> Result<EntityTag, crate::error::ParseError> {
let length = slice.len();
// Early exits if it doesn't terminate in a DQUOTE.
if !slice.ends_with('"') || slice.len() < 2 {
return Err(crate::error::ParseError::Header);