Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
kornelski committed Jul 19, 2019
1 parent ea17c21 commit 5285ef8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,8 @@ impl Matcher {
value == other
},
Matcher::UrlEncoded(ref expected_field, ref expected_value) => {
other.split("&").map( |pair| {
let mut parts = pair.splitn(2, "=");
other.split('&').map( |pair| {
let mut parts = pair.splitn(2, '=');
let field = percent_decode(parts.next().unwrap().as_bytes()).decode_utf8_lossy();
let value = percent_decode(parts.next().unwrap_or("").as_bytes()).decode_utf8_lossy();

Expand Down Expand Up @@ -668,8 +668,8 @@ impl Mock {
match path.into() {
// We also allow setting the query as part of the path argument
// but we split it under the hood into `Matcher::Exact` elements.
Matcher::Exact(ref raw_path) if raw_path.contains("?") => {
let mut parts = raw_path.splitn(2, "?");
Matcher::Exact(ref raw_path) if raw_path.contains('?') => {
let mut parts = raw_path.splitn(2, '?');
(parts.next().unwrap().into(), parts.next().unwrap_or("").into())
},
other => {
Expand All @@ -680,8 +680,8 @@ impl Mock {
Self {
id: thread_rng().sample_iter(&Alphanumeric).take(24).collect(),
method: method.to_owned().to_uppercase(),
path: path,
query: query,
path,
query,
headers: Vec::new(),
body: Matcher::Any,
response: Response::default(),
Expand Down
2 changes: 1 addition & 1 deletion src/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ impl<'a> From<&'a TcpStream> for Request {
}

if let Some(a) = req.path {
let mut parts = a.splitn(2, "?");
let mut parts = a.splitn(2, '?');
request.path += parts.next().unwrap();
request.query += parts.next().unwrap_or("");
}
Expand Down

0 comments on commit 5285ef8

Please sign in to comment.