added context on possible unreachable error

This commit is contained in:
2026-03-10 00:02:39 +01:00
parent 16ed5f9a46
commit 257ff66af8

View File

@@ -16,7 +16,15 @@ pub struct Game {
impl Game {
pub fn export_links(&self) -> Result<Vec<Link>, io::Error> {
let links: Vec<Link> = walk_all_files(&self.path)?
.map(|entry| Link::new(entry.path(), entry.path().strip_prefix(&self.path).unwrap()))
.map(|entry| {
Link::new(
entry.path(),
entry
.path()
.strip_prefix(&self.path)
.expect("Can't transform path back to relative. Should not happen."),
)
})
.collect();
Ok(links)