From 8023b2bd43f17c23b20e4efc14f815ce98cf4a9b Mon Sep 17 00:00:00 2001 From: "Kevin R. Thornton" Date: Mon, 22 Aug 2022 09:45:29 -0700 Subject: [PATCH] fix clippy lint (#143) * refactor: Metadata now uses custom deserializer serde_yaml 0.9.7 resulted in a regression, accepting `metadata:` (empty metadata mappings) instead of returning Err. See dtolnay/serde-yaml#304 and dtolnay/serde-yaml#312 This change uses a custom deserializer to error in this case. * fix: fix clippy::unnecessary_to_owned lint --- src/specification.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/specification.rs b/src/specification.rs index b8b3c1b4..8ed2a77e 100644 --- a/src/specification.rs +++ b/src/specification.rs @@ -2532,7 +2532,7 @@ impl Graph { let mut rv = DemeMap::default(); for deme in &self.demes { - if rv.contains_key(&deme.name().to_string()) { + if rv.contains_key(deme.name().deref()) { return Err(DemesError::DemeError(format!( "duplicate deme name: {}", deme.name(),