From 4d6cdbf405515935525e90e640a819e790ffe4ca Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 31 Mar 2020 08:20:13 +0600 Subject: [PATCH] cleanup clippy warnings --- ntex-router/CHANGES.txt | 2 +- ntex-router/Cargo.toml | 8 ++++---- ntex-router/src/lib.rs | 6 +++--- ntex-router/src/tree.rs | 4 ++-- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ntex-router/CHANGES.txt b/ntex-router/CHANGES.txt index dba783572..da391fb67 100644 --- a/ntex-router/CHANGES.txt +++ b/ntex-router/CHANGES.txt @@ -1,6 +1,6 @@ # Changes -## [0.3.0] - 2020-03-22 +## [0.3.0] - 2020-03-31 * Case insensitive routing diff --git a/ntex-router/Cargo.toml b/ntex-router/Cargo.toml index 61a4fffa9..88cac1c9d 100644 --- a/ntex-router/Cargo.toml +++ b/ntex-router/Cargo.toml @@ -4,7 +4,7 @@ version = "0.3.0" authors = ["Nikolay Kim "] description = "Path router" keywords = ["ntex"] -repository = "https://github.com/fafhrd91/ntex.git" +repository = "https://github.com/ntex-rs/ntex.git" documentation = "https://docs.rs/ntex-router/" license = "MIT" edition = "2018" @@ -19,10 +19,10 @@ default = ["http"] [dependencies] regex = "1.3.5" serde = "1.0.105" -bytestring = "0.1.2" +bytestring = "0.1.5" log = "0.4.8" -http = { version = "0.2.0", optional = true } +http = { version = "0.2.1", optional = true } [dev-dependencies] -http = "0.2.0" +http = "0.2.1" serde_derive = "1.0" diff --git a/ntex-router/src/lib.rs b/ntex-router/src/lib.rs index 2bdd81bef..e4bb8c9fc 100644 --- a/ntex-router/src/lib.rs +++ b/ntex-router/src/lib.rs @@ -22,7 +22,7 @@ pub trait Resource { pub trait ResourcePath { fn path(&self) -> &str; - fn unquote<'a>(s: &'a str) -> std::borrow::Cow<'a, str> { + fn unquote(s: &str) -> std::borrow::Cow<'_, str> { s.into() } } @@ -70,7 +70,7 @@ impl<'a> IntoPattern for &'a str { impl> IntoPattern for Vec { fn patterns(&self) -> Vec { - self.into_iter().map(|v| v.as_ref().to_string()).collect() + self.iter().map(|v| v.as_ref().to_string()).collect() } } @@ -128,7 +128,7 @@ mod http_support { self.path() } - fn unquote<'a>(s: &'a str) -> std::borrow::Cow<'a, str> { + fn unquote(s: &str) -> std::borrow::Cow<'_, str> { if let Some(q) = super::quoter::requote(s.as_bytes()) { std::borrow::Cow::Owned(q) } else { diff --git a/ntex-router/src/tree.rs b/ntex-router/src/tree.rs index 20e3d0912..d2b0b2668 100644 --- a/ntex-router/src/tree.rs +++ b/ntex-router/src/tree.rs @@ -243,7 +243,7 @@ impl Tree { return if let Some((val, skip)) = res { let path = resource.resource_path(); path.segments = segments; - path.skip = path.skip + skip as u16; + path.skip += skip as u16; Some(val) } else { None @@ -265,7 +265,7 @@ impl Tree { { let path = resource.resource_path(); path.segments = segments; - path.skip = path.skip + skip as u16; + path.skip += skip as u16; Some(val) } else { None