mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 07:53:00 +01:00
clippy warnings
This commit is contained in:
parent
70a3f317d3
commit
c3f8b5cf22
@ -832,7 +832,7 @@ impl ResourceDef {
|
|||||||
}).expect("malformed param");
|
}).expect("malformed param");
|
||||||
let (mut param, rem) = pattern.split_at(close_idx + 1);
|
let (mut param, rem) = pattern.split_at(close_idx + 1);
|
||||||
param = ¶m[1..param.len() - 1]; // Remove outer brackets
|
param = ¶m[1..param.len() - 1]; // Remove outer brackets
|
||||||
let (name, pattern) = match param.find(":") {
|
let (name, pattern) = match param.find(':') {
|
||||||
Some(idx) => {
|
Some(idx) => {
|
||||||
let (name, pattern) = param.split_at(idx);
|
let (name, pattern) = param.split_at(idx);
|
||||||
(name, &pattern[1..])
|
(name, &pattern[1..])
|
||||||
@ -849,7 +849,7 @@ impl ResourceDef {
|
|||||||
fn parse(
|
fn parse(
|
||||||
mut pattern: &str, for_prefix: bool,
|
mut pattern: &str, for_prefix: bool,
|
||||||
) -> (String, Vec<PatternElement>, bool, usize) {
|
) -> (String, Vec<PatternElement>, bool, usize) {
|
||||||
if pattern.find("{").is_none() {
|
if pattern.find('{').is_none() {
|
||||||
return (
|
return (
|
||||||
String::from(pattern),
|
String::from(pattern),
|
||||||
vec![PatternElement::Str(String::from(pattern))],
|
vec![PatternElement::Str(String::from(pattern))],
|
||||||
@ -861,7 +861,7 @@ impl ResourceDef {
|
|||||||
let mut elems = Vec::new();
|
let mut elems = Vec::new();
|
||||||
let mut re = String::from("^");
|
let mut re = String::from("^");
|
||||||
|
|
||||||
while let Some(idx) = pattern.find("{") {
|
while let Some(idx) = pattern.find('{') {
|
||||||
let (prefix, rem) = pattern.split_at(idx);
|
let (prefix, rem) = pattern.split_at(idx);
|
||||||
elems.push(PatternElement::Str(String::from(prefix)));
|
elems.push(PatternElement::Str(String::from(prefix)));
|
||||||
re.push_str(&escape(prefix));
|
re.push_str(&escape(prefix));
|
||||||
|
@ -3,7 +3,7 @@ use std::rc::Rc;
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use std::{io, mem, net, time};
|
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 futures::{Future, Stream};
|
||||||
use net2::{TcpBuilder, TcpStreamExt};
|
use net2::{TcpBuilder, TcpStreamExt};
|
||||||
@ -636,7 +636,9 @@ where
|
|||||||
|
|
||||||
fn shutdown(&self, force: bool) {
|
fn shutdown(&self, force: bool) {
|
||||||
if force {
|
if force {
|
||||||
self.settings.head().traverse(|ch: &mut HttpChannel<TcpStream, H>| ch.shutdown());
|
self.settings
|
||||||
|
.head()
|
||||||
|
.traverse(|ch: &mut HttpChannel<TcpStream, H>| ch.shutdown());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user