From d1f7e346cd04ebc7ec56a62cba550ea5be1683da Mon Sep 17 00:00:00 2001 From: Tim Biermann Date: Sun, 27 Oct 2024 15:25:50 +0100 Subject: [PATCH 1/3] fix clippy::needless_borrows_for_generic_args --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 7e04757..9649e7d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,7 +14,7 @@ extern crate dirs; /// ``` pub fn tico(path: &str, home_dir: Option<&str>) -> String { let tico = match home_dir { - Some(dir) => path.replacen(&dir, "~", 1), + Some(dir) => path.replacen(dir, "~", 1), None => path.to_owned(), }; From 1db072c45f9a71d288363d32bb61561ddd9eab7d Mon Sep 17 00:00:00 2001 From: Tim Biermann Date: Sun, 27 Oct 2024 15:26:19 +0100 Subject: [PATCH 2/3] fix clippy::unused_io_amount --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 27cbe6c..200973d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,6 @@ fn main() { let home_dir_str = home_dir.to_str(); std::io::stdout() - .write(tico::tico(&path, home_dir_str).as_bytes()) + .write_all(tico::tico(&path, home_dir_str).as_bytes()) .unwrap(); } From 4c15461f20388a6ed00a874c7f65a5fd62824630 Mon Sep 17 00:00:00 2001 From: Tim Biermann Date: Sun, 27 Oct 2024 15:27:46 +0100 Subject: [PATCH 3/3] updated rust edition, added release profile, updated dependencies --- Cargo.toml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3d789d3..9160812 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,10 +8,17 @@ homepage = "https://github.com/portocodes/tico" repository = "https://github.com/portocodes/tico" readme = "README.md" license = "MIT" +edition = "2021" + +[profile.release] +lto = true +codegen-units = 1 +strip = true +opt-level = 3 [[bin]] name = "tico" doc = false [dependencies] -dirs = "2.0.2" +dirs = "5"