Skip to content

Commit

Permalink
cleanup clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
fafhrd91 committed Mar 31, 2020
1 parent c73e642 commit 4d6cdbf
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ntex-router/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Changes

## [0.3.0] - 2020-03-22
## [0.3.0] - 2020-03-31

* Case insensitive routing

Expand Down
8 changes: 4 additions & 4 deletions ntex-router/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version = "0.3.0"
authors = ["Nikolay Kim <[email protected]>"]
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"
Expand All @@ -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"
6 changes: 3 additions & 3 deletions ntex-router/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub trait Resource<T: ResourcePath> {
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()
}
}
Expand Down Expand Up @@ -70,7 +70,7 @@ impl<'a> IntoPattern for &'a str {

impl<T: AsRef<str>> IntoPattern for Vec<T> {
fn patterns(&self) -> Vec<String> {
self.into_iter().map(|v| v.as_ref().to_string()).collect()
self.iter().map(|v| v.as_ref().to_string()).collect()
}
}

Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions ntex-router/src/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4d6cdbf

Please sign in to comment.