summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2022-11-14 12:03:48 +0200
committerLars Wirzenius <liw@liw.fi>2022-11-14 12:03:48 +0200
commit5f9d36c3da1640010e09caa5156d49617c8890b6 (patch)
treeb25cbd99647b67bfe1ef86193581a26e7700434d /src
parent96d6946a0b4fbd194b1c5bf9dae74e37e5612882 (diff)
downloadjt2-5f9d36c3da1640010e09caa5156d49617c8890b6.tar.gz
chore: drop unnecessary borrows, noticed by clippy
Sponsored-by: author
Diffstat (limited to 'src')
-rw-r--r--src/config.rs2
-rw-r--r--src/git.rs2
-rw-r--r--src/journal.rs2
3 files changed, 3 insertions, 3 deletions
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<Self, JournalError> {
- 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<P: AsRef<Path>>(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))?;
}