summaryrefslogtreecommitdiff
path: root/src/journal.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-05-23 08:34:22 +0000
committerLars Wirzenius <liw@liw.fi>2021-05-23 08:34:22 +0000
commit96c269190104ce3be4ecb071352d129ace9ea93a (patch)
treecb61a5cdb47c007eb66ce61e645b42d064b85512 /src/journal.rs
parent4bf43dc56719df211b111d5a71f28c0d0e14b922 (diff)
parenta19f4254b73cc981e0559a2c5e1ac7c214fdfe4e (diff)
downloadjt2-96c269190104ce3be4ecb071352d129ace9ea93a.tar.gz
Merge branch 'fixes' into 'main'
chore: fix clippy warnings, use new Subplot binary name See merge request larswirzenius/jt!17
Diffstat (limited to 'src/journal.rs')
-rw-r--r--src/journal.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/journal.rs b/src/journal.rs
index 2610a44..8042f83 100644
--- a/src/journal.rs
+++ b/src/journal.rs
@@ -105,19 +105,19 @@ impl Journal {
return Ok(pathname);
}
}
- return Err(JournalError::TooManyDrafts(
+ Err(JournalError::TooManyDrafts(
MAX_DRAFT_COUNT,
dirname.to_path_buf(),
- ));
+ ))
}
pub fn pick_draft(&self, id: &str) -> Result<PathBuf, JournalError> {
let drafts = self.drafts();
let filename = drafts.join(format!("{}.md", id));
if filename.exists() {
- return Ok(filename);
+ Ok(filename)
} else {
- return Err(JournalError::NoSuchDraft(id.to_string(), self.drafts()));
+ Err(JournalError::NoSuchDraft(id.to_string(), self.drafts()))
}
}
@@ -206,7 +206,6 @@ fn topic_path(dirname: &Path, topic: &Path) -> PathBuf {
}
fn current_timestamp() -> String {
- let now = Local::now();
- let now: DateTime<Local> = DateTime::from(now);
+ let now: DateTime<Local> = Local::now();
now.to_rfc2822()
}