mirror of
https://github.com/rzmk/czv.git
synced 2025-12-19 08:09:24 +00:00
refactor: improve error-handling, fix lints, & update criterion
This commit is contained in:
parent
f435642358
commit
c0b76fa543
6 changed files with 58 additions and 118 deletions
|
|
@ -13,5 +13,5 @@ crate-type = ["cdylib", "rlib"]
|
|||
anyhow = "1.0.86"
|
||||
csv = "1.3.0"
|
||||
czv = { path = "../czv" }
|
||||
pyo3 = { version = "0.21.2", features = ["extension-module"] }
|
||||
pyo3 = { version = "0.21.2", features = ["anyhow", "extension-module"] }
|
||||
thiserror = "1.0.61"
|
||||
|
|
|
|||
|
|
@ -8,25 +8,25 @@ pub struct CzvError(anyhow::Error);
|
|||
|
||||
impl From<OGError> for CzvError {
|
||||
fn from(value: OGError) -> Self {
|
||||
value.into()
|
||||
Self(anyhow::anyhow!(value))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<pyo3::PyErr> for CzvError {
|
||||
fn from(value: pyo3::PyErr) -> Self {
|
||||
value.into()
|
||||
Self(anyhow::anyhow!(value))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<csv::Error> for CzvError {
|
||||
fn from(value: csv::Error) -> Self {
|
||||
value.into()
|
||||
Self(anyhow::anyhow!(value))
|
||||
}
|
||||
}
|
||||
|
||||
impl From<CzvError> for pyo3::PyErr {
|
||||
fn from(value: CzvError) -> Self {
|
||||
value.into()
|
||||
anyhow::anyhow!(value).into()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue