From 67be21d9cba8cdc9f65cd6f33ec75718529691c3 Mon Sep 17 00:00:00 2001 From: Waleed Khan Date: Mon, 2 May 2022 21:34:26 -0700 Subject: [PATCH] cleanup: fix some `cargo clippy` warnings --- src/diff_edit.rs | 2 +- testing/fake-diff-editor.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/diff_edit.rs b/src/diff_edit.rs index 91dbcfe75..ade090500 100644 --- a/src/diff_edit.rs +++ b/src/diff_edit.rs @@ -197,7 +197,7 @@ impl MergeTool { /// Loads merge tool options from `[merge-tools.]`. The given name is used /// as an executable name if no configuration found for that name. fn get_tool(settings: &UserSettings, name: &str) -> Result { - const TABLE_KEY: &'static str = "merge-tools"; + const TABLE_KEY: &str = "merge-tools"; let tools_table = match settings.config().get_table(TABLE_KEY) { Ok(table) => table, Err(ConfigError::NotFound(_)) => return Ok(MergeTool::with_program(name)), diff --git a/testing/fake-diff-editor.rs b/testing/fake-diff-editor.rs index ddca57a80..2cb51f4fc 100644 --- a/testing/fake-diff-editor.rs +++ b/testing/fake-diff-editor.rs @@ -13,7 +13,7 @@ // limitations under the License. use std::collections::HashSet; -use std::path::PathBuf; +use std::path::{Path, PathBuf}; use std::process::exit; use clap::Parser; @@ -30,7 +30,7 @@ struct Args { after: PathBuf, } -fn files_recursively(dir: &PathBuf) -> HashSet { +fn files_recursively(dir: &Path) -> HashSet { let mut files = HashSet::new(); for dir_entry in std::fs::read_dir(dir).unwrap() { let dir_entry = dir_entry.unwrap();