diff options
author | Lars Wirzenius <liw@liw.fi> | 2022-11-10 11:50:46 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2022-11-12 09:02:48 +0200 |
commit | d1c2cd39f5a9a1fcfbf6b96af3ab18cc65518462 (patch) | |
tree | 5704d9ebffc1d44a338b46840878a5cfb8537809 | |
parent | c0ed7a3b60ad7b98fb7953443a0e0cceb2298666 (diff) | |
download | subplot-d1c2cd39f5a9a1fcfbf6b96af3ab18cc65518462.tar.gz |
chore: fix unnecessary borrows found by clippy
Sponsored-by: author
-rw-r--r-- | src/ast.rs | 2 | ||||
-rw-r--r-- | src/bindings.rs | 2 | ||||
-rw-r--r-- | subplotlib/build.rs | 2 |
3 files changed, 3 insertions, 3 deletions
@@ -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<CaptureType, Regex> = { 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()); |