diff --git a/CHANGELOG.md b/CHANGELOG.md index a34c3a1..3aa71b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## v0.3.6 (2022-09-24) + +* **Fix::** Don't register root path (`/`) as it doesn't have a filename to match against + ## v0.3.5 (2022-09-19) * **BREAKING:** Renamed the `optimize` action to `cleanup` diff --git a/Cargo.lock b/Cargo.lock index 22651b2..4b93262 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -134,7 +134,7 @@ dependencies = [ [[package]] name = "jumpy" -version = "0.3.5" +version = "0.3.6" dependencies = [ "clap", "dirs", diff --git a/Cargo.toml b/Cargo.toml index 1ea69fe..b25c947 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "jumpy" -version = "0.3.5" +version = "0.3.6" edition = "2021" [dependencies] diff --git a/src/index.rs b/src/index.rs index d1538ca..d24abcf 100644 --- a/src/index.rs +++ b/src/index.rs @@ -36,6 +36,11 @@ impl Index { .ok_or_else(|| format!("Path contains invalid UTF-8 characters: {path}"))? .to_string(); + // Silently ignore root path + if path == "/" { + return Ok(()); + } + match self.scored_entries.entry(path) { Entry::Occupied(mut entry) => { *entry.get_mut() = update_score(*entry.get());