From ed802ff909740a7889c1ed64e3efbf0d0aff7120 Mon Sep 17 00:00:00 2001 From: Lukas Winkler Date: Sat, 5 Feb 2022 21:43:52 +0100 Subject: [PATCH] add clippy feedback --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/main.rs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 747fd45..77f3a33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,4 +4,4 @@ version = 3 [[package]] name = "prettypwd" -version = "0.1.0" +version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index 5f2a504..2b26302 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "prettypwd" -version = "0.1.0" +version = "0.1.1" edition = "2021" [dependencies] diff --git a/src/main.rs b/src/main.rs index cbe2d3d..5c593f3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ use std::env; fn simplify_string(pwd: String, home: String) -> String { let prettyhome = pwd.replacen(home.as_str(), "/~", 1); - let dirs: Vec<&str> = prettyhome.split("/").collect(); + let dirs: Vec<&str> = prettyhome.split('/').collect(); let mut print_dirs: Vec<&str> = Vec::new(); if dirs.len() > 4 { if dirs[1] != "~" { @@ -17,7 +17,7 @@ fn simplify_string(pwd: String, home: String) -> String { print_dirs = dirs } // println!("{:#?}", print_dirs); - return print_dirs.join("/").replacen("/~", "~", 1); + print_dirs.join("/").replacen("/~", "~", 1) } fn main() {