diff --git a/src/types/game.rs b/src/types/game.rs index 3a759e9..b10f1d6 100644 --- a/src/types/game.rs +++ b/src/types/game.rs @@ -16,7 +16,15 @@ pub struct Game { impl Game { pub fn export_links(&self) -> Result, io::Error> { let links: Vec = 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)