diff options
author | Daniel Silverstone <dsilvers@digital-scurf.org> | 2021-05-20 00:25:42 +0100 |
---|---|---|
committer | Daniel Silverstone <dsilvers@digital-scurf.org> | 2021-05-20 00:25:42 +0100 |
commit | 6bf39fdb44dcbcd29c13b71aaa22c01b4741ec51 (patch) | |
tree | d9555b2e58ba198fcd9f3128e9681ca0d5457b31 /src/metadata.rs | |
parent | e762e23a9ac7b36c6abfc8c45d1b48407263007f (diff) | |
download | subplot-6bf39fdb44dcbcd29c13b71aaa22c01b4741ec51.tar.gz |
chore: Fix a bunch of clippy lints
Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'src/metadata.rs')
-rw-r--r-- | src/metadata.rs | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/src/metadata.rs b/src/metadata.rs index 3f4916a..8406e38 100644 --- a/src/metadata.rs +++ b/src/metadata.rs @@ -63,11 +63,7 @@ impl Metadata { /// Return date of document, if any. pub fn date(&self) -> Option<&str> { - if let Some(date) = &self.date { - Some(&date) - } else { - None - } + self.date.as_deref() } /// Return filename where bindings are specified. @@ -85,10 +81,7 @@ impl Metadata { /// Return the name of the code template, if specified. pub fn template_name(&self) -> Option<&str> { - match &self.template { - Some(x) => Some(&x), - None => None, - } + self.template.as_deref() } /// Return the bindings. @@ -118,11 +111,7 @@ fn get_title(map: &Mapp) -> String { } fn get_date(map: &Mapp) -> Option<String> { - if let Some(s) = get_string(map, "date") { - Some(s) - } else { - None - } + get_string(map, "date") } fn get_bindings_filenames<P>(basedir: P, map: &Mapp) -> Vec<PathBuf> |