minor, use Try

This commit is contained in:
João M. Bezerra 2023-04-16 22:57:54 -03:00
parent 9c06a68964
commit d926e0f00a

View File

@ -117,10 +117,7 @@ where
Err(e) => return Some(Err(e.into())), Err(e) => return Some(Err(e.into())),
}; };
let path = match file.enclosed_name() { let path = file.enclosed_name()?.to_owned();
Some(path) => path.to_owned(),
None => return None,
};
let is_dir = file.is_dir(); let is_dir = file.is_dir();
Some(Ok(FileInArchive { path, is_dir })) Some(Ok(FileInArchive { path, is_dir }))