From d1c2cd39f5a9a1fcfbf6b96af3ab18cc65518462 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Thu, 10 Nov 2022 11:50:46 +0200 Subject: chore: fix unnecessary borrows found by clippy Sponsored-by: author --- src/ast.rs | 2 +- src/bindings.rs | 2 +- subplotlib/build.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ast.rs b/src/ast.rs index 15843eb..14a57be 100644 --- a/src/ast.rs +++ b/src/ast.rs @@ -371,7 +371,7 @@ impl YamlMetadata { fn mapping_to_pandoc(mapping: &Mapping) -> MetaValue { let mut map = Map::new(); for (key, value) in mapping.iter() { - let key = if let MetaValue::MetaString(s) = value_to_pandoc(&key) { + let key = if let MetaValue::MetaString(s) = value_to_pandoc(key) { s } else { panic!("key not a string: {:?}", key); diff --git a/src/bindings.rs b/src/bindings.rs index 8e3531b..98379c9 100644 --- a/src/bindings.rs +++ b/src/bindings.rs @@ -787,7 +787,7 @@ mod test_bindings { lazy_static! { static ref KIND_PATTERNS: HashMap = { let mut map = HashMap::new(); - for ty in (&[ + for ty in ([ CaptureType::Word, CaptureType::Text, CaptureType::Int, diff --git a/subplotlib/build.rs b/subplotlib/build.rs index e5f8917..77e493a 100644 --- a/subplotlib/build.rs +++ b/subplotlib/build.rs @@ -22,7 +22,7 @@ fn gen_tests() { .chain(glob("../tests/subplots/common/*.subplot").expect("failed to find common subplots")); for entry in subplots { let entry = entry.expect("failed to get subplot dir entry in subplotlib"); - let mut inc = tests.join(&entry.file_name().unwrap()); + let mut inc = tests.join(entry.file_name().unwrap()); inc.set_extension("rs"); if !inc.exists() { panic!("missing include file: {}", inc.display()); -- cgit v1.2.1