From 5285ef8508e2d54109c2fb81d32b5fe1a2050a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kornel=20Lesi=C5=84ski?= Date: Fri, 19 Jul 2019 10:57:43 +0100 Subject: [PATCH] Clippy --- src/lib.rs | 12 ++++++------ src/request.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e2194b3..ceb90de 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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(); @@ -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 => { @@ -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(), diff --git a/src/request.rs b/src/request.rs index f6e47f9..c84325c 100644 --- a/src/request.rs +++ b/src/request.rs @@ -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(""); }