added context on possible unreachable error
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user