diff options
Diffstat (limited to 'src/journal.rs')
-rw-r--r-- | src/journal.rs | 11 |
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() } |