Skip to content

Commit

Permalink
fix clippy lint (#143)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
molpopgen committed Aug 22, 2022
1 parent d073023 commit 8023b2b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/specification.rs
Expand Up @@ -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(),
Expand Down

0 comments on commit 8023b2b

Please sign in to comment.