From c3f8b5cf22c7d4b6c903a2a930d1cdd7c155c449 Mon Sep 17 00:00:00 2001 From: Nikolay Kim Date: Tue, 11 Sep 2018 11:25:32 -0700 Subject: [PATCH] clippy warnings --- src/router.rs | 6 +++--- src/server/http.rs | 6 ++++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/router.rs b/src/router.rs index ab84838f1..aa15e46d2 100644 --- a/src/router.rs +++ b/src/router.rs @@ -832,7 +832,7 @@ impl ResourceDef { }).expect("malformed param"); let (mut param, rem) = pattern.split_at(close_idx + 1); param = ¶m[1..param.len() - 1]; // Remove outer brackets - let (name, pattern) = match param.find(":") { + let (name, pattern) = match param.find(':') { Some(idx) => { let (name, pattern) = param.split_at(idx); (name, &pattern[1..]) @@ -849,7 +849,7 @@ impl ResourceDef { fn parse( mut pattern: &str, for_prefix: bool, ) -> (String, Vec, bool, usize) { - if pattern.find("{").is_none() { + if pattern.find('{').is_none() { return ( String::from(pattern), vec![PatternElement::Str(String::from(pattern))], @@ -861,7 +861,7 @@ impl ResourceDef { let mut elems = Vec::new(); let mut re = String::from("^"); - while let Some(idx) = pattern.find("{") { + while let Some(idx) = pattern.find('{') { let (prefix, rem) = pattern.split_at(idx); elems.push(PatternElement::Str(String::from(prefix))); re.push_str(&escape(prefix)); diff --git a/src/server/http.rs b/src/server/http.rs index f9b2689ef..948889f42 100644 --- a/src/server/http.rs +++ b/src/server/http.rs @@ -3,7 +3,7 @@ use std::rc::Rc; use std::sync::Arc; use std::{io, mem, net, time}; -use actix::{Arbiter, Actor, Addr, AsyncContext, Context, Handler, System}; +use actix::{Actor, Addr, Arbiter, AsyncContext, Context, Handler, System}; use futures::{Future, Stream}; use net2::{TcpBuilder, TcpStreamExt}; @@ -636,7 +636,9 @@ where fn shutdown(&self, force: bool) { if force { - self.settings.head().traverse(|ch: &mut HttpChannel| ch.shutdown()); + self.settings + .head() + .traverse(|ch: &mut HttpChannel| ch.shutdown()); } } }