Skip to content

Commit

Permalink
Fix: correctly handle some paths
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementNerma committed Dec 14, 2023
1 parent 82cc7ff commit b5a4aa0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "jumpy"
version = "0.3.9"
version = "0.3.10"
edition = "2021"
authors = ["Clément Nerma <clement.nerma@gmail.com>"]
license = "Apache-2.0"
Expand Down
10 changes: 4 additions & 6 deletions src/index.rs
Expand Up @@ -77,14 +77,12 @@ impl Index {
let mut entries = self
.scored_entries
.iter()
.filter(|(path, _)| {
.filter_map(|(path, scope)| {
Path::new(path)
.file_name()
.unwrap()
.to_str()
.unwrap()
.to_lowercase()
.contains(&query)
.and_then(|filename| filename.to_str())
.filter(|filename| filename.to_lowercase().contains(&query))
.map(|_| (path, scope))
})
.map(IndexEntry::from)
.collect::<Vec<_>>();
Expand Down

0 comments on commit b5a4aa0

Please sign in to comment.