From 5f9d36c3da1640010e09caa5156d49617c8890b6 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Mon, 14 Nov 2022 12:03:48 +0200 Subject: chore: drop unnecessary borrows, noticed by clippy Sponsored-by: author --- src/config.rs | 2 +- src/git.rs | 2 +- src/journal.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/config.rs b/src/config.rs index 03b54ce..6995e24 100644 --- a/src/config.rs +++ b/src/config.rs @@ -24,7 +24,7 @@ struct InputConfiguration { impl InputConfiguration { fn read(filename: &Path) -> Result { - let text = std::fs::read(&filename) + let text = std::fs::read(filename) .map_err(|err| JournalError::ReadConfig(filename.to_path_buf(), err))?; let config = serde_yaml::from_slice(&text) .map_err(|err| JournalError::ConfigSyntax(filename.to_path_buf(), err))?; diff --git a/src/git.rs b/src/git.rs index 9aa8a52..5bb53f0 100644 --- a/src/git.rs +++ b/src/git.rs @@ -49,7 +49,7 @@ pub fn commit>(dirname: P, msg: &str) -> Result<(), JournalError> debug!("git commit in {}", dirname.display()); let output = Command::new("git") - .args(&["commit", "-m", msg]) + .args(["commit", "-m", msg]) .current_dir(dirname) .output() .map_err(|err| JournalError::SpawnGit(dirname.to_path_buf(), err))?; diff --git a/src/journal.rs b/src/journal.rs index 270bb19..44d632f 100644 --- a/src/journal.rs +++ b/src/journal.rs @@ -206,7 +206,7 @@ impl Journal { let pathname = topic_path(self.dirname(), path); let parent = pathname.parent().unwrap(); if !parent.is_dir() { - std::fs::create_dir_all(&parent) + std::fs::create_dir_all(parent) .map_err(|err| JournalError::CreateDirectory(parent.to_path_buf(), err))?; } -- cgit v1.2.1