Merge pull request #322 from dtolnay/unused

Remove unused imports and needless borrows
This commit is contained in:
David Tolnay 2016-05-13 11:23:15 -07:00
commit 9865ec23c7
6 changed files with 7 additions and 11 deletions

View File

@ -41,7 +41,7 @@ impl<'a> From<&'a [u8]> for Bytes<'a> {
impl<'a> From<&'a Vec<u8>> for Bytes<'a> {
fn from(bytes: &'a Vec<u8>) -> Self {
Bytes {
bytes: &bytes,
bytes: bytes,
}
}
}
@ -165,7 +165,7 @@ mod bytebuf {
fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error>
where S: ser::Serializer
{
serializer.serialize_bytes(&self)
serializer.serialize_bytes(self)
}
}

View File

@ -118,7 +118,7 @@ impl Visitor for BoolVisitor {
fn visit_str<E>(&mut self, s: &str) -> Result<bool, E>
where E: Error,
{
match s.trim_matches(|c| ::utils::Pattern_White_Space(c)) {
match s.trim_matches(::utils::Pattern_White_Space) {
"true" => Ok(true),
"false" => Ok(false),
_ => Err(Error::invalid_type(Type::Bool)),

View File

@ -9,7 +9,6 @@ use syntax::ast::{
};
use syntax::codemap::Span;
use syntax::ext::base::{Annotatable, ExtCtxt};
use syntax::ext::build::AstBuilder;
use syntax::parse::token::InternedString;
use syntax::ptr::P;

View File

@ -1,9 +1,9 @@
use test::Bencher;
use std::error;
use std::fmt;
use rustc_serialize::{Decoder, Decodable};
use rustc_serialize::Decodable;
use serde;
use serde::de::{Deserializer, Deserialize};
use serde::de::Deserialize;
//////////////////////////////////////////////////////////////////////////////

View File

@ -3,10 +3,10 @@ use test::Bencher;
use std::fmt;
use std::error;
use rustc_serialize::{Decoder, Decodable};
use rustc_serialize::Decodable;
use serde;
use serde::de::{Deserializer, Deserialize};
use serde::de::Deserialize;
//////////////////////////////////////////////////////////////////////////////

View File

@ -2,9 +2,6 @@ use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::net;
use std::path::PathBuf;
extern crate serde;
use self::serde::de::Deserializer;
use token::{
Error,
Token,