Skip to content

Commit

Permalink
Fix: don't register root path (/) as it doesn't have a filename to match
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementNerma committed Sep 24, 2022
1 parent b02a825 commit 62daa0c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions 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`
Expand Down
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.5"
version = "0.3.6"
edition = "2021"

[dependencies]
Expand Down
5 changes: 5 additions & 0 deletions src/index.rs
Expand Up @@ -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());
Expand Down

0 comments on commit 62daa0c

Please sign in to comment.