Skip to content

Commit 0db0f9d

Browse files
committed
fix(index): Don't error on non-existent local entries
1 parent a5ca0f2 commit 0db0f9d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/index.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ impl LocalIndex {
157157
.strip_prefix("index")
158158
.map_err(|_err| anyhow::format_err!("invalid index path {entry_path:?}"))?;
159159
let entry_path = self.root.join(rel_path);
160-
let entry = std::fs::read(&entry_path)?;
160+
let Ok(entry) = std::fs::read(&entry_path) else {
161+
return Ok(None);
162+
};
161163
let results = IndexKrate::from_slice(&entry)?;
162164
Ok(Some(results))
163165
}

0 commit comments

Comments
 (0)