diff options
author | axtlos <axtlos@disroot.org> | 2024-04-19 23:26:20 +0200 |
---|---|---|
committer | axtlos <axtlos@disroot.org> | 2024-04-19 23:26:20 +0200 |
commit | e73783b1ba769fc84aa563ba45a918860635fe18 (patch) | |
tree | 0d91353d81817cee3a164040b891c3917c383761 /src/main.rs | |
parent | b5d8342696c9283e1e6df9b58de05b57451e6636 (diff) | |
download | deskwhich-e73783b1ba769fc84aa563ba45a918860635fe18.tar.gz deskwhich-e73783b1ba769fc84aa563ba45a918860635fe18.tar.bz2 |
Improve name matching
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index fa89851..da05a34 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,7 +29,8 @@ fn main() { }; for file in files { let desktop_file = format!("{}", file.as_ref().unwrap().file_name().into_string().unwrap()); - if desktop_file.contains(&cli.search) { + let mut name = desktop_file.split("."); + if name.find(|x| *x == cli.search).is_some() { let path = file.as_ref().unwrap().path(); let out = if cli.show_tilde { format!("{}", path.display().to_string().replace(&home, "~")) |