Explorar o código

extract: return if it fails to extract a file

Alexandre Janniaux %!s(int64=5) %!d(string=hai) anos
pai
achega
2ffa4ce949
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      src/main.rs

+ 2 - 1
src/main.rs

@@ -48,7 +48,8 @@ fn extract(input: PathBuf, output_directory: PathBuf)
 
         file_list.push(output_filename);
 
-        io::copy(&mut entry, &mut file);
+        io::copy(&mut entry, &mut file)
+            .map_err(|_| ())?;
     }
 
     Ok(file_list)