mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-06 11:35:45 +00:00
Solved FinalError compile errors
This commit is contained in:
parent
09b050d836
commit
6c6f721f35
@ -13,7 +13,7 @@ use walkdir::WalkDir;
|
||||
use crate::{
|
||||
error::FinalError,
|
||||
info, oof,
|
||||
utils::{self, to_utf, Bytes},
|
||||
utils::{self, Bytes},
|
||||
};
|
||||
|
||||
pub fn unpack_archive(reader: Box<dyn Read>, output_folder: &Path, flags: &oof::Flags) -> crate::Result<Vec<PathBuf>> {
|
||||
@ -60,17 +60,11 @@ where
|
||||
builder.append_dir(path, path)?;
|
||||
} else {
|
||||
let mut file = fs::File::open(path)?;
|
||||
dbg!(&path);
|
||||
dbg!(&file);
|
||||
dbg!(&entry);
|
||||
dbg!(&previous_location);
|
||||
dbg!(&filename);
|
||||
|
||||
// builder.append_file(path, file.file_mut())?;
|
||||
builder.append_file(path, file.file_mut()).map_err(|err| {
|
||||
FinalError::with_title(format!("Could not create archive '{}'", to_utf(path.clone()))) // output_path == writer? da
|
||||
.detail(format!("Unexpected error while trying to read file '{}'", to_utf(output_path)))
|
||||
FinalError::with_title("Could not create archive")
|
||||
.detail("Unexpected error while trying to read file")
|
||||
.detail(format!("Error: {}.", err))
|
||||
.into_owned()
|
||||
})?;
|
||||
}
|
||||
}
|
||||
|
@ -205,3 +205,9 @@ impl From<oof::OofError> for Error {
|
||||
Self::OofError(err)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<FinalError> for Error {
|
||||
fn from(err: FinalError) -> Self {
|
||||
Self::Custom { reason: err }
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user