diff --git a/api/src/handlers/blocks_api.rs b/api/src/handlers/blocks_api.rs index aabb29fb5..935bf5af6 100644 --- a/api/src/handlers/blocks_api.rs +++ b/api/src/handlers/blocks_api.rs @@ -68,7 +68,7 @@ impl HeaderHandler { impl Handler for HeaderHandler { fn get(&self, req: Request<Body>) -> ResponseFuture { - let el = match req.uri().path().trim_right_matches("/").rsplit("/").next() { + let el = match req.uri().path().trim_right_matches('/').rsplit('/').next() { None => return response(StatusCode::BAD_REQUEST, "invalid url"), Some(el) => el, }; @@ -125,12 +125,12 @@ fn check_block_param(input: &String) -> Result<(), Error> { "Not a valid hash or height.".to_owned(), ))?; } - return Ok(()); + Ok(()) } impl Handler for BlockHandler { fn get(&self, req: Request<Body>) -> ResponseFuture { - let el = match req.uri().path().trim_right_matches("/").rsplit("/").next() { + let el = match req.uri().path().trim_right_matches('/').rsplit('/').next() { None => return response(StatusCode::BAD_REQUEST, "invalid url"), Some(el) => el, }; diff --git a/api/src/handlers/chain_api.rs b/api/src/handlers/chain_api.rs index 150de6821..910838671 100644 --- a/api/src/handlers/chain_api.rs +++ b/api/src/handlers/chain_api.rs @@ -111,7 +111,7 @@ impl OutputHandler { for (k, id) in params { if k == "id" { - for id in id.split(",") { + for id in id.split(',') { commitments.push(id.to_owned()); } } @@ -178,7 +178,7 @@ impl OutputHandler { if let Some(ids) = params.get("id") { for id in ids { - for id in id.split(",") { + for id in id.split(',') { if let Ok(x) = util::from_hex(String::from(id)) { commitments.push(Commitment::from_vec(x)); } @@ -223,7 +223,7 @@ impl OutputHandler { impl Handler for OutputHandler { fn get(&self, req: Request<Body>) -> ResponseFuture { - let command = match req.uri().path().trim_right_matches("/").rsplit("/").next() { + let command = match req.uri().path().trim_right_matches('/').rsplit('/').next() { Some(c) => c, None => return response(StatusCode::BAD_REQUEST, "invalid url"), }; diff --git a/api/src/handlers/peers_api.rs b/api/src/handlers/peers_api.rs index c700b54b1..2dd7be113 100644 --- a/api/src/handlers/peers_api.rs +++ b/api/src/handlers/peers_api.rs @@ -56,7 +56,7 @@ pub struct PeerHandler { impl Handler for PeerHandler { fn get(&self, req: Request<Body>) -> ResponseFuture { - let command = match req.uri().path().trim_right_matches("/").rsplit("/").next() { + let command = match req.uri().path().trim_right_matches('/').rsplit('/').next() { Some(c) => c, None => return response(StatusCode::BAD_REQUEST, "invalid url"), }; @@ -73,7 +73,7 @@ impl Handler for PeerHandler { } } fn post(&self, req: Request<Body>) -> ResponseFuture { - let mut path_elems = req.uri().path().trim_right_matches("/").rsplit("/"); + let mut path_elems = req.uri().path().trim_right_matches('/').rsplit('/'); let command = match path_elems.next() { None => return response(StatusCode::BAD_REQUEST, "invalid url"), Some(c) => c,