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" 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(), }; 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(); }