Fix issues found by rust-clippy

This commit is contained in:
Corey Farwell 2015-10-12 19:40:48 -04:00
parent 6303126e0c
commit 20beaf5af3
23 changed files with 106 additions and 121 deletions

View file

@ -75,10 +75,9 @@ fn send_error(url: Url, err: String, start_chan: LoadConsumer) {
let mut metadata: Metadata = Metadata::default(url);
metadata.status = None;
match start_sending_opt(start_chan, metadata) {
Ok(p) => p.send(Done(Err(err))).unwrap(),
_ => {}
};
if let Ok(p) = start_sending_opt(start_chan, metadata) {
p.send(Done(Err(err))).unwrap();
}
}
enum ReadResult {
@ -157,8 +156,8 @@ pub trait HttpResponse: Read {
fn content_encoding(&self) -> Option<Encoding> {
self.headers().get::<ContentEncoding>().and_then(|h| {
match h {
&ContentEncoding(ref encodings) => {
match *h {
ContentEncoding(ref encodings) => {
if encodings.contains(&Encoding::Gzip) {
Some(Encoding::Gzip)
} else if encodings.contains(&Encoding::Deflate) {