1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-28 01:32:57 +01:00

clippy warnings

This commit is contained in:
Nikolay Kim 2018-09-11 11:25:32 -07:00
parent 70a3f317d3
commit c3f8b5cf22
2 changed files with 7 additions and 5 deletions

View File

@ -832,7 +832,7 @@ impl ResourceDef {
}).expect("malformed param");
let (mut param, rem) = pattern.split_at(close_idx + 1);
param = &param[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<PatternElement>, 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));

View File

@ -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<TcpStream, H>| ch.shutdown());
self.settings
.head()
.traverse(|ch: &mut HttpChannel<TcpStream, H>| ch.shutdown());
}
}
}