From 337fb3204fc41e1f91e83e4e2a7e0fc9d036f25f Mon Sep 17 00:00:00 2001 From: Lukas Kalbertodt Date: Mon, 24 Oct 2022 10:17:51 +0200 Subject: [PATCH] Fix some clippy warnings --- src/env.rs | 2 +- src/template.rs | 2 +- src/toml.rs | 2 +- src/yaml.rs | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/env.rs b/src/env.rs index 33e3aa5..5b12e05 100644 --- a/src/env.rs +++ b/src/env.rs @@ -10,7 +10,7 @@ use serde::de::IntoDeserializer; /// Semantically private, only public as it's used in the API of the `internal` /// module. Gets converted into `ErrorKind::EnvDeserialization` before reaching /// the real public API. -#[derive(PartialEq)] +#[derive(PartialEq, Eq)] pub struct DeError(pub(crate) String); impl std::error::Error for DeError {} diff --git a/src/template.rs b/src/template.rs index 96f4b96..ab5a8ce 100644 --- a/src/template.rs +++ b/src/template.rs @@ -222,7 +222,7 @@ fn format_impl(out: &mut impl Formatter, meta: &Meta, options: &FormatOptions) { emitted_anything = true; let comments = if options.comments { field.doc } else { &[] }; - out.start_nested(&field.name, comments); + out.start_nested(field.name, comments); format_impl(out, meta, options); out.end_nested(); } diff --git a/src/toml.rs b/src/toml.rs index 7217e6c..9917b59 100644 --- a/src/toml.rs +++ b/src/toml.rs @@ -180,7 +180,7 @@ impl fmt::Display for PrintExpr<'_> { match entry.key { MapKey::Str(s) if is_valid_bare_key(s) => f.write_str(s)?, - _ => PrintExpr(&entry.key.clone().into()).fmt(f)?, + _ => PrintExpr(&entry.key.into()).fmt(f)?, } f.write_str(" = ")?; PrintExpr(&entry.value).fmt(f)?; diff --git a/src/yaml.rs b/src/yaml.rs index bea49f4..964a184 100644 --- a/src/yaml.rs +++ b/src/yaml.rs @@ -197,7 +197,7 @@ impl fmt::Display for PrintExpr<'_> { if i != 0 { f.write_str(", ")?; } - PrintExpr(&entry.key.clone().into()).fmt(f)?; + PrintExpr(&entry.key.into()).fmt(f)?; f.write_str(": ")?; PrintExpr(&entry.value).fmt(f)?; }