Compare commits

...

14 commits

17 changed files with 156 additions and 142 deletions

1
.github/FUNDING.yml vendored
View file

@ -1 +0,0 @@
github: [rzmk]

24
.github/workflows/cargo-runner.yml vendored Normal file
View file

@ -0,0 +1,24 @@
name: Run cargo commands
on:
push:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: czv - latest
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- stable
# - beta
# - nightly
steps:
- uses: actions/checkout@v4
- run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }}
- run: cargo clippy
- run: cargo test --verbose

142
Cargo.lock generated
View file

@ -17,35 +17,24 @@ version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299"
[[package]]
name = "anstyle"
version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b"
[[package]]
name = "anyhow"
version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da"
[[package]]
name = "atty"
version = "0.2.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8"
dependencies = [
"hermit-abi",
"libc",
"winapi",
]
[[package]]
name = "autocfg"
version = "1.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0"
[[package]]
name = "bitflags"
version = "1.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
[[package]]
name = "bitflags"
version = "2.5.0"
@ -99,24 +88,28 @@ dependencies = [
[[package]]
name = "clap"
version = "3.2.25"
version = "4.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123"
checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f"
dependencies = [
"bitflags 1.3.2",
"clap_builder",
]
[[package]]
name = "clap_builder"
version = "4.5.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f"
dependencies = [
"anstyle",
"clap_lex",
"indexmap",
"textwrap",
]
[[package]]
name = "clap_lex"
version = "0.2.4"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5"
dependencies = [
"os_str_bytes",
]
checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70"
[[package]]
name = "console_error_panic_hook"
@ -130,19 +123,19 @@ dependencies = [
[[package]]
name = "criterion"
version = "0.4.0"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb"
checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f"
dependencies = [
"anes",
"atty",
"cast",
"ciborium",
"clap",
"criterion-plot",
"is-terminal",
"itertools",
"lazy_static",
"num-traits",
"once_cell",
"oorandom",
"plotters",
"rayon",
@ -218,7 +211,7 @@ dependencies = [
[[package]]
name = "czv"
version = "0.0.1"
version = "0.0.2"
dependencies = [
"anyhow",
"criterion",
@ -281,12 +274,6 @@ dependencies = [
"crunchy",
]
[[package]]
name = "hashbrown"
version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
[[package]]
name = "heck"
version = "0.4.1"
@ -295,22 +282,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
[[package]]
name = "hermit-abi"
version = "0.1.19"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33"
dependencies = [
"libc",
]
[[package]]
name = "indexmap"
version = "1.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99"
dependencies = [
"autocfg",
"hashbrown",
]
checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024"
[[package]]
name = "indoc"
@ -318,6 +292,17 @@ version = "2.0.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b248f5224d1d606005e02c97f5aa4e88eeb230488bcc03bc9ca4d7991399f2b5"
[[package]]
name = "is-terminal"
version = "0.4.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b"
dependencies = [
"hermit-abi",
"libc",
"windows-sys",
]
[[package]]
name = "itertools"
version = "0.10.5"
@ -342,12 +327,6 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "lazy_static"
version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]]
name = "libc"
version = "0.2.155"
@ -406,12 +385,6 @@ version = "11.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575"
[[package]]
name = "os_str_bytes"
version = "6.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e2355d85b9a3786f481747ced0e0ff2ba35213a1f9bd406ed906554d7af805a1"
[[package]]
name = "parking_lot"
version = "0.12.3"
@ -471,9 +444,9 @@ checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0"
[[package]]
name = "proc-macro2"
version = "1.0.85"
version = "1.0.86"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23"
checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77"
dependencies = [
"unicode-ident",
]
@ -484,6 +457,7 @@ version = "0.21.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8"
dependencies = [
"anyhow",
"cfg-if",
"indoc",
"libc",
@ -576,7 +550,7 @@ version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd"
dependencies = [
"bitflags 2.5.0",
"bitflags",
]
[[package]]
@ -696,9 +670,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67"
[[package]]
name = "syn"
version = "2.0.66"
version = "2.0.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5"
checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90"
dependencies = [
"proc-macro2",
"quote",
@ -711,12 +685,6 @@ version = "0.12.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f"
[[package]]
name = "textwrap"
version = "0.16.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9"
[[package]]
name = "thiserror"
version = "1.0.61"
@ -915,22 +883,6 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "winapi"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419"
dependencies = [
"winapi-i686-pc-windows-gnu",
"winapi-x86_64-pc-windows-gnu",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
[[package]]
name = "winapi-util"
version = "0.1.8"
@ -940,12 +892,6 @@ dependencies = [
"windows-sys",
]
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
[[package]]
name = "windows-sys"
version = "0.52.0"

View file

@ -5,7 +5,7 @@ czv includes libraries for Rust, Python, and WebAssembly (JavaScript and TypeScr
## Links
- czv GitHub repository: <https://github.com/rzmk/czv>
- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv))
- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv)) ([docs](https://docs.rs/czv))
- WebAssembly (JavaScript/TypeScript): [npmjs.com/package/czv-wasm](https://www.npmjs.com/package/czv-wasm) ([source code](https://github.com/rzmk/czv/tree/main/czv-wasm))
- Python: [pypi.org/project/czv](https://pypi.org/project/czv/) ([source code](https://github.com/rzmk/czv/tree/main/czv-python))
@ -29,8 +29,11 @@ apple,2.50
banana,3.00
strawberry,1.50
";
let output: usize = RowCount::new().file_data(data).execute()?;
println!("{output}"); // 3
let output: usize = RowCount::new()
.file_data(data)
.include_header_row(true)
.execute()?;
println!("{output}"); // 4
Ok(())
}
```
@ -63,6 +66,8 @@ const output: number = czv.rowCount({
console.log(output);
```
You can view source code for an example website using `czv-wasm` at https://github.com/rzmk/czv/tree/main/czv-wasm/examples/web-demo.
### Python
```bash
@ -87,9 +92,9 @@ print(output) # 4
## Available operations
| czv (Rust) | czv-wasm (JS/TS) | czv-python | Summary |
| ---------------------------------------- | -------------------------------------- | ----------------------------------------------- | ------------------------- |
| [`count::RowCount`](czv/src/count.rs) | [`rowCount`](czv-wasm/src/count.rs) | [`count.row_count`](czv-python/src/count.rs) | Get the number of rows |
| [`count::ColumnCount`](czv/src/count.rs) | [`columnCount`](czv-wasm/src/count.rs) | [`count.column_count`](czv-python/src/count.rs) | Get the number of columns |
| --------------------------------- | -------------------------------------- | ----------------------------------------- | ------------------------- |
| [`RowCount`](czv/src/count.rs) | [`rowCount`](czv-wasm/src/count.rs) | [`row_count`](czv-python/src/count.rs) | Get the number of rows |
| [`ColumnCount`](czv/src/count.rs) | [`columnCount`](czv-wasm/src/count.rs) | [`column_count`](czv-python/src/count.rs) | Get the number of columns |
## Development

View file

@ -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"

View file

@ -5,7 +5,7 @@ Python library for [czv](https://github.com/rzmk/czv). czv is a library of CSV-r
## Links
- czv GitHub repository: <https://github.com/rzmk/czv>
- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv))
- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv)) ([docs](https://docs.rs/czv))
- WebAssembly (JavaScript/TypeScript): [npmjs.com/package/czv-wasm](https://www.npmjs.com/package/czv-wasm) ([source code](https://github.com/rzmk/czv/tree/main/czv-wasm))
- Python: [pypi.org/project/czv](https://pypi.org/project/czv/) ([source code](https://github.com/rzmk/czv/tree/main/czv-python))

View file

@ -27,7 +27,7 @@ print(output) # 4
## Links
- czv GitHub repository: <https://github.com/rzmk/czv>
- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv))
- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv)) ([docs](https://docs.rs/czv))
- WebAssembly (JavaScript/TypeScript): [npmjs.com/package/czv-wasm](https://www.npmjs.com/package/czv-wasm) ([source code](https://github.com/rzmk/czv/tree/main/czv-wasm))
- Python: [pypi.org/project/czv](https://pypi.org/project/czv/) ([source code](https://github.com/rzmk/czv/tree/main/czv-python))

View file

@ -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()
}
}

View file

@ -2,12 +2,12 @@ import czv
import pytest
from .test_data import test_data
class TestCountFunc:
class TestRowCount:
@pytest.mark.parametrize(
"file_name,expected",
[("fruits.csv", 3), ("constituents_altnames.csv", 33971)],
)
def test_count(self, file_name, expected):
def test_row_count(self, file_name, expected):
"""Count the total number of non-header rows."""
result = czv.row_count(file_path=test_data[file_name])
@ -17,8 +17,19 @@ class TestCountFunc:
"file_name,expected",
[("fruits.csv", 4), ("constituents_altnames.csv", 33972)],
)
def test_include_header_row(self, file_name, expected):
def test_row_count_include_header_row(self, file_name, expected):
"""Count the total number of rows including the header row."""
result = czv.row_count(file_path=test_data[file_name], include_header_row=True)
assert result == expected
class TestColumnCount:
@pytest.mark.parametrize(
"file_name,expected",
[("fruits.csv", 2), ("constituents_altnames.csv", 6)],
)
def test_column_count(self, file_name, expected):
"""Count the total number of columns."""
result = czv.column_count(file_path=test_data[file_name])
assert result == expected

View file

@ -5,7 +5,7 @@ WebAssembly (JavaScript and TypeScript) library for [czv](https://github.com/rzm
## Links
- czv GitHub repository: <https://github.com/rzmk/czv>
- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv))
- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv)) ([docs](https://docs.rs/czv))
- WebAssembly (JavaScript/TypeScript): [npmjs.com/package/czv-wasm](https://www.npmjs.com/package/czv-wasm) ([source code](https://github.com/rzmk/czv/tree/main/czv-wasm))
- Python: [pypi.org/project/czv](https://pypi.org/project/czv/) ([source code](https://github.com/rzmk/czv/tree/main/czv-python))

View file

@ -1,3 +1,5 @@
// See the README.md file in this file's folder
// for how to run this example
import czv from "../../pkg/czv-ts";
const options: czv.RowCountOptions = {
@ -5,6 +7,7 @@ const options: czv.RowCountOptions = {
apple,2.50
banana,3.00
strawberry,1.50`,
include_header_row: true
};
const output: number = czv.rowCount(options);

View file

@ -29,7 +29,7 @@
//! # Links
//!
//! - czv GitHub repository: <https://github.com/rzmk/czv>
//! - Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv))
//! - Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv)) ([docs](https://docs.rs/czv))
//! - WebAssembly (JavaScript/TypeScript): [npmjs.com/package/czv-wasm](https://www.npmjs.com/package/czv-wasm) ([source code](https://github.com/rzmk/czv/tree/main/czv-wasm))
//! - Python: [pypi.org/project/czv](https://pypi.org/project/czv/) ([source code](https://github.com/rzmk/czv/tree/main/czv-python))
@ -44,19 +44,13 @@ use wasm_bindgen::JsValue;
// Error-handling helpers
#[derive(thiserror::Error, Debug)]
pub enum CzvError {
#[error("{0}")]
pub struct CzvError(anyhow::Error);
impl From<csv::Error> for CzvError {
fn from(value: csv::Error) -> Self {
value.into()
}
}
impl From<serde_wasm_bindgen::Error> for CzvError {
fn from(value: serde_wasm_bindgen::Error) -> Self {
value.into()
}
GeneralError(#[from] anyhow::Error),
#[error("{0}")]
CsvError(#[from] csv::Error),
#[error("{0}")]
SerdeWasmBindgenError(#[from] serde_wasm_bindgen::Error),
}
impl From<CzvError> for JsValue {

View file

@ -1,12 +1,12 @@
use czv_wasm;
use czv_wasm::count::RowCountOptions;
use czv_wasm::count::{ColumnCountOptions, RowCountOptions};
use czv_wasm::Result;
use wasm_bindgen_test::*;
wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser);
#[test]
#[wasm_bindgen_test]
fn basic() -> Result<()> {
fn row_count_nonheader() -> Result<()> {
let options = RowCountOptions {
file_data: "fruit,price
apple,2.00
@ -19,3 +19,34 @@ strawberry,3.00"
assert_eq!(result, 3);
Ok(())
}
#[test]
#[wasm_bindgen_test]
fn row_count_header() -> Result<()> {
let options = RowCountOptions {
file_data: "fruit,price
apple,2.00
banana,1.50
strawberry,3.00"
.to_string(),
include_header_row: Some(true),
};
let result = czv_wasm::count::row_count(options)?;
assert_eq!(result, 4);
Ok(())
}
#[test]
#[wasm_bindgen_test]
fn column_count() -> Result<()> {
let options = ColumnCountOptions {
file_data: "fruit,price
apple,2.00
banana,1.50
strawberry,3.00"
.to_string(),
};
let result = czv_wasm::count::column_count(options)?;
assert_eq!(result, 2);
Ok(())
}

View file

@ -1,6 +1,6 @@
[package]
name = "czv"
version = "0.0.1"
version = "0.0.2"
authors = ["Mueez Khan"]
description = "Rust library for performing CSV-related operations for data engineering and analysis."
repository = "https://github.com/rzmk/czv"
@ -16,7 +16,7 @@ thiserror = "1.0.61"
typed-builder = "0.18.2"
[dev-dependencies]
criterion = { version = "0.4", features = ["html_reports"] }
criterion = { version = "0.5", features = ["html_reports"] }
[[bench]]
name = "benches"

View file

@ -5,7 +5,7 @@ Rust library for [czv](https://github.com/rzmk/czv). czv is a library of CSV-rel
## Links
- czv GitHub repository: <https://github.com/rzmk/czv>
- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv))
- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv)) ([docs](https://docs.rs/czv))
- WebAssembly (JavaScript/TypeScript): [npmjs.com/package/czv-wasm](https://www.npmjs.com/package/czv-wasm) ([source code](https://github.com/rzmk/czv/tree/main/czv-wasm))
- Python: [pypi.org/project/czv](https://pypi.org/project/czv/) ([source code](https://github.com/rzmk/czv/tree/main/czv-python))
@ -67,9 +67,9 @@ For benchmarks we use [criterion.rs](https://github.com/bheisler/criterion.rs).
Licensed under either of
- Apache License, Version 2.0
([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
(http://www.apache.org/licenses/LICENSE-2.0)
- MIT license
([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
(http://opensource.org/licenses/MIT)
at your option.

View file

@ -207,6 +207,7 @@ impl<
__file_path: typed_builder::Optional<Option<PathBuf>>,
> ColumnCountBuilder<(__file_path, __file_data)>
{
/// Returns the column count.
pub fn execute(self) -> Result<usize> {
let builder = self.__build();
column_count(builder.file_path, builder.file_data)

View file

@ -33,7 +33,7 @@
//! # Links
//!
//! - czv GitHub repository: <https://github.com/rzmk/czv>
//! - Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv))
//! - Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/czv)) ([docs](https://docs.rs/czv))
//! - WebAssembly (JavaScript/TypeScript): [npmjs.com/package/czv-wasm](https://www.npmjs.com/package/czv-wasm) ([source code](https://github.com/rzmk/czv/tree/main/czv-wasm))
//! - Python: [pypi.org/project/czv](https://pypi.org/project/czv/) ([source code](https://github.com/rzmk/czv/tree/main/czv-python))
@ -41,7 +41,7 @@
pub mod count;
#[doc(inline)]
pub use count::{ColumnCount, RowCount};
/// Extract a section of rows.
// Extract a section of rows.
// pub mod slice;
// #[doc(inline)]
// pub use slice::Slice;
@ -55,13 +55,13 @@ pub struct CzvError(pub anyhow::Error);
impl From<anyhow::Error> for CzvError {
fn from(value: anyhow::Error) -> Self {
value.into()
Self(value)
}
}
impl From<csv::Error> for CzvError {
fn from(value: csv::Error) -> Self {
value.into()
Self(anyhow::anyhow!(value))
}
}