Created constructor functions and paniced
This commit is contained in:
@@ -6,4 +6,5 @@ edition = "2021"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
paste = "*"
|
||||
cdtypes = {path = "../cdtypes"}
|
||||
paste = "*"
|
@@ -74,6 +74,12 @@ impl std::convert::From<std::io::Error> for Error {
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::From<cdtypes::Error> for Error {
|
||||
fn from(error: cdtypes::Error) -> Self {
|
||||
Error::from_error(error)
|
||||
}
|
||||
}
|
||||
|
||||
pub fn open_output(output_file: Option<PathBuf>) -> Result<Output, Error> {
|
||||
match output_file {
|
||||
Some(output_path) => Ok(Box::new(std::io::BufWriter::new(std::fs::File::create(output_path)?))),
|
||||
|
Reference in New Issue
Block a user