From 300b125c023dd126db203b7c0b50de2ff0ee8fae Mon Sep 17 00:00:00 2001 From: Manos Pitsidianakis Date: Mon, 18 Dec 2023 20:48:11 +0200 Subject: [PATCH] Fix clippy lints Signed-off-by: Manos Pitsidianakis --- archive-http/src/main.rs | 6 +++--- core/rustfmt.toml | 1 + core/src/posts.rs | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) create mode 120000 core/rustfmt.toml diff --git a/archive-http/src/main.rs b/archive-http/src/main.rs index b486d83..e6ae3cc 100644 --- a/archive-http/src/main.rs +++ b/archive-http/src/main.rs @@ -38,8 +38,8 @@ fn run_app() -> std::result::Result<(), Box> { return Err("Output path is not a directory.".into()); } - std::fs::create_dir_all(&output_path.join("lists"))?; - std::fs::create_dir_all(&output_path.join("list"))?; + std::fs::create_dir_all(output_path.join("lists"))?; + std::fs::create_dir_all(output_path.join("list"))?; let conf = Configuration::from_file(config_path) .map_err(|err| format!("Could not load config {config_path}: {err}"))?; @@ -67,7 +67,7 @@ fn run_app() -> std::result::Result<(), Box> { .write(true) .create(true) .truncate(true) - .open(&output_path.join("index.html"))?; + .open(output_path.join("index.html"))?; let crumbs = vec![Crumb { label: "Lists".into(), url: format!("{root_url_prefix}/").into(), diff --git a/core/rustfmt.toml b/core/rustfmt.toml new file mode 120000 index 0000000..39f97b0 --- /dev/null +++ b/core/rustfmt.toml @@ -0,0 +1 @@ +../rustfmt.toml \ No newline at end of file diff --git a/core/src/posts.rs b/core/src/posts.rs index b3bef9a..ffc0228 100644 --- a/core/src/posts.rs +++ b/core/src/posts.rs @@ -43,7 +43,7 @@ impl Connection { } else { from_[0].get_email() }; - let datetime: std::borrow::Cow<'_, str> = if !env.date.as_str().is_empty() { + let datetime: std::borrow::Cow<'_, str> = if !env.date.is_empty() { env.date.as_str().into() } else { melib::datetime::timestamp_to_string(