From e8097b14f1ea246bf97af380670c502ba1517f30 Mon Sep 17 00:00:00 2001 From: "leonardo.yvens" Date: Fri, 3 Jun 2016 23:14:42 -0300 Subject: Clippy run --- src/decoder/mod.rs | 6 +++--- src/decoder/rustc_serialize.rs | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/decoder') diff --git a/src/decoder/mod.rs b/src/decoder/mod.rs index a596280..b223e03 100644 --- a/src/decoder/mod.rs +++ b/src/decoder/mod.rs @@ -126,11 +126,11 @@ impl Decoder { fn sub_decoder(&self, toml: Option, field: &str) -> Decoder { Decoder { toml: toml, - cur_field: if field.len() == 0 { + cur_field: if field.is_empty() { self.cur_field.clone() } else { match self.cur_field { - None => Some(format!("{}", field)), + None => Some(field.to_string()), Some(ref s) => Some(format!("{}.{}", s, field)) } }, @@ -172,7 +172,7 @@ impl fmt::Display for DecodeError { ExpectedType(expected, found) => { fn humanize(s: &str) -> String { if s == "section" { - format!("a section") + "a section".to_string() } else { format!("a value of type `{}`", s) } diff --git a/src/decoder/rustc_serialize.rs b/src/decoder/rustc_serialize.rs index 2f4fb09..f850663 100644 --- a/src/decoder/rustc_serialize.rs +++ b/src/decoder/rustc_serialize.rs @@ -171,7 +171,7 @@ impl rustc_serialize::Decoder for Decoder { -> Result where F: FnOnce(&mut Decoder) -> Result { - let field = format!("{}", f_name); + let field = f_name.to_string(); let toml = match self.toml { Some(Value::Table(ref mut table)) => { table.remove(&field) @@ -324,7 +324,7 @@ impl rustc_serialize::Decoder for Decoder { fn error(&mut self, err: &str) -> DecodeError { DecodeError { field: self.cur_field.clone(), - kind: ApplicationError(format!("{}", err)) + kind: ApplicationError(err.to_string()) } } } -- cgit v1.2.3