mirror of
https://github.com/ouch-org/ouch.git
synced 2025-06-07 12:05:46 +00:00
Solved FinalError compile errors
This commit is contained in:
parent
09b050d836
commit
6c6f721f35
@ -13,7 +13,7 @@ use walkdir::WalkDir;
|
|||||||
use crate::{
|
use crate::{
|
||||||
error::FinalError,
|
error::FinalError,
|
||||||
info, oof,
|
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>> {
|
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)?;
|
builder.append_dir(path, path)?;
|
||||||
} else {
|
} else {
|
||||||
let mut file = fs::File::open(path)?;
|
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| {
|
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
|
FinalError::with_title("Could not create archive")
|
||||||
.detail(format!("Unexpected error while trying to read file '{}'", to_utf(output_path)))
|
.detail("Unexpected error while trying to read file")
|
||||||
.detail(format!("Error: {}.", err))
|
.detail(format!("Error: {}.", err))
|
||||||
|
.into_owned()
|
||||||
})?;
|
})?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -205,3 +205,9 @@ impl From<oof::OofError> for Error {
|
|||||||
Self::OofError(err)
|
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