diff options
| author | krolxon <krolyxon@tutanota.com> | 2024-05-16 18:08:34 +0530 |
|---|---|---|
| committer | krolxon <krolyxon@tutanota.com> | 2024-05-16 18:08:34 +0530 |
| commit | 1d70e28c4e133cdefd432bdb7c6656ca63f9b278 (patch) | |
| tree | ce2d7ddc0cb8e9bc7c667be7a069d6b324f3bc0c /src | |
| parent | ce06f50e56b7c47a8530c598fc79da78bbae3435 (diff) | |
assert filenames instead of seeing if it contains
Diffstat (limited to 'src')
| -rwxr-xr-x | src/app.rs | 5 | ||||
| -rwxr-xr-x | src/ui.rs | 3 |
2 files changed, 6 insertions, 2 deletions
@@ -190,7 +190,10 @@ impl App { .queue_list .list .iter() - .position(|x| x.file.contains(path)); + .position(|x| { + let file = x.file.split("/").last().unwrap(); + file.eq(path) + }); if index.is_some() { self.conn.conn.switch(index.unwrap() as u32)?; @@ -76,7 +76,8 @@ fn draw_directory_browser(frame: &mut Frame, app: &mut App, size: Rect) { let mut status: bool = false; for sn in app.queue_list.list.iter() { - if sn.file.contains(s) { + let file = sn.file.split("/").last().unwrap(); + if file.eq(s) { status = true; } } |
