diff options
author | Alex Crichton <alex@alexcrichton.com> | 2016-06-05 07:46:17 +0200 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2016-06-05 07:46:17 +0200 |
commit | fb8050d2d556dd613971f15e7bd73cfd43acad82 (patch) | |
tree | eaae854e5e6d5b61e9039d30217f821a8a2f30f7 /src/decoder/mod.rs | |
parent | 7363dbe7f599a2373e6e2a749f51c76469dabdcf (diff) | |
parent | e8097b14f1ea246bf97af380670c502ba1517f30 (diff) | |
download | milf-rs-fb8050d2d556dd613971f15e7bd73cfd43acad82.tar.gz milf-rs-fb8050d2d556dd613971f15e7bd73cfd43acad82.zip |
Merge pull request #101 from leodasvacas/clippy-run
Clippy run and implement Default for State and Enconder
Diffstat (limited to 'src/decoder/mod.rs')
-rw-r--r-- | src/decoder/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
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<Value>, 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) } |