diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..baa721a --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [rzmk] diff --git a/.github/workflows/cargo-runner.yml b/.github/workflows/cargo-runner.yml deleted file mode 100644 index 9e30554..0000000 --- a/.github/workflows/cargo-runner.yml +++ /dev/null @@ -1,24 +0,0 @@ -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 diff --git a/Cargo.lock b/Cargo.lock index 8ce783d..acccdc7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,24 +17,35 @@ 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" @@ -88,28 +99,24 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.7" +version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ - "clap_builder", -] - -[[package]] -name = "clap_builder" -version = "4.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" -dependencies = [ - "anstyle", + "bitflags 1.3.2", "clap_lex", + "indexmap", + "textwrap", ] [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] [[package]] name = "console_error_panic_hook" @@ -123,19 +130,19 @@ dependencies = [ [[package]] name = "criterion" -version = "0.5.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" +checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" dependencies = [ "anes", + "atty", "cast", "ciborium", "clap", "criterion-plot", - "is-terminal", "itertools", + "lazy_static", "num-traits", - "once_cell", "oorandom", "plotters", "rayon", @@ -211,7 +218,7 @@ dependencies = [ [[package]] name = "czv" -version = "0.0.2" +version = "0.0.1" dependencies = [ "anyhow", "criterion", @@ -274,6 +281,12 @@ 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" @@ -282,9 +295,22 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.9" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +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", +] [[package]] name = "indoc" @@ -292,17 +318,6 @@ 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" @@ -327,6 +342,12 @@ 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" @@ -385,6 +406,12 @@ 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" @@ -444,9 +471,9 @@ checksum = "7170ef9988bc169ba16dd36a7fa041e5c4cbeb6a35b76d4c03daded371eae7c0" [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] @@ -457,7 +484,6 @@ version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5e00b96a521718e08e03b1a622f01c8a8deb50719335de3f60b3b3950f069d8" dependencies = [ - "anyhow", "cfg-if", "indoc", "libc", @@ -550,7 +576,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags", + "bitflags 2.5.0", ] [[package]] @@ -670,9 +696,9 @@ checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "syn" -version = "2.0.67" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -685,6 +711,12 @@ 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" @@ -883,6 +915,22 @@ 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" @@ -892,6 +940,12 @@ 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" diff --git a/README.md b/README.md index 642569c..eb785ca 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ czv includes libraries for Rust, Python, and WebAssembly (JavaScript and TypeScr ## Links - czv GitHub repository: -- 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)) +- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/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,11 +29,8 @@ apple,2.50 banana,3.00 strawberry,1.50 "; - let output: usize = RowCount::new() - .file_data(data) - .include_header_row(true) - .execute()?; - println!("{output}"); // 4 + let output: usize = RowCount::new().file_data(data).execute()?; + println!("{output}"); // 3 Ok(()) } ``` @@ -66,8 +63,6 @@ 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 @@ -91,10 +86,10 @@ print(output) # 4 ## Available operations -| czv (Rust) | czv-wasm (JS/TS) | czv-python | Summary | -| --------------------------------- | -------------------------------------- | ----------------------------------------- | ------------------------- | -| [`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 | +| 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 | ## Development diff --git a/czv-python/Cargo.toml b/czv-python/Cargo.toml index 616902d..24b0028 100644 --- a/czv-python/Cargo.toml +++ b/czv-python/Cargo.toml @@ -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 = ["anyhow", "extension-module"] } +pyo3 = { version = "0.21.2", features = ["extension-module"] } thiserror = "1.0.61" diff --git a/czv-python/README.md b/czv-python/README.md index db51388..284e5c9 100644 --- a/czv-python/README.md +++ b/czv-python/README.md @@ -5,7 +5,7 @@ Python library for [czv](https://github.com/rzmk/czv). czv is a library of CSV-r ## Links - czv GitHub repository: -- 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)) +- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/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)) diff --git a/czv-python/czv.pyi b/czv-python/czv.pyi index 775c69e..ed45162 100644 --- a/czv-python/czv.pyi +++ b/czv-python/czv.pyi @@ -27,7 +27,7 @@ print(output) # 4 ## Links - czv GitHub repository: -- 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)) +- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/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)) diff --git a/czv-python/src/lib.rs b/czv-python/src/lib.rs index 8bdcc25..4c401de 100644 --- a/czv-python/src/lib.rs +++ b/czv-python/src/lib.rs @@ -8,25 +8,25 @@ pub struct CzvError(anyhow::Error); impl From for CzvError { fn from(value: OGError) -> Self { - Self(anyhow::anyhow!(value)) + value.into() } } impl From for CzvError { fn from(value: pyo3::PyErr) -> Self { - Self(anyhow::anyhow!(value)) + value.into() } } impl From for CzvError { fn from(value: csv::Error) -> Self { - Self(anyhow::anyhow!(value)) + value.into() } } impl From for pyo3::PyErr { fn from(value: CzvError) -> Self { - anyhow::anyhow!(value).into() + value.into() } } diff --git a/czv-python/tests/test_count.py b/czv-python/tests/test_count.py index e5b2f9a..c796835 100644 --- a/czv-python/tests/test_count.py +++ b/czv-python/tests/test_count.py @@ -2,12 +2,12 @@ import czv import pytest from .test_data import test_data -class TestRowCount: +class TestCountFunc: @pytest.mark.parametrize( "file_name,expected", [("fruits.csv", 3), ("constituents_altnames.csv", 33971)], ) - def test_row_count(self, file_name, expected): + def test_count(self, file_name, expected): """Count the total number of non-header rows.""" result = czv.row_count(file_path=test_data[file_name]) @@ -17,19 +17,8 @@ class TestRowCount: "file_name,expected", [("fruits.csv", 4), ("constituents_altnames.csv", 33972)], ) - def test_row_count_include_header_row(self, file_name, expected): + def test_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 diff --git a/czv-wasm/README.md b/czv-wasm/README.md index 18ef562..6e5cbde 100644 --- a/czv-wasm/README.md +++ b/czv-wasm/README.md @@ -5,7 +5,7 @@ WebAssembly (JavaScript and TypeScript) library for [czv](https://github.com/rzm ## Links - czv GitHub repository: -- 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)) +- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/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)) diff --git a/czv-wasm/examples/node-demo/sample.ts b/czv-wasm/examples/node-demo/sample.ts index 8197c19..f969962 100644 --- a/czv-wasm/examples/node-demo/sample.ts +++ b/czv-wasm/examples/node-demo/sample.ts @@ -1,5 +1,3 @@ -// 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 = { @@ -7,7 +5,6 @@ const options: czv.RowCountOptions = { apple,2.50 banana,3.00 strawberry,1.50`, - include_header_row: true }; const output: number = czv.rowCount(options); diff --git a/czv-wasm/src/lib.rs b/czv-wasm/src/lib.rs index 54bb076..f51340d 100644 --- a/czv-wasm/src/lib.rs +++ b/czv-wasm/src/lib.rs @@ -29,7 +29,7 @@ //! # Links //! //! - czv GitHub repository: -//! - 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)) +//! - Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/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,13 +44,19 @@ use wasm_bindgen::JsValue; // Error-handling helpers #[derive(thiserror::Error, Debug)] -pub enum CzvError { - #[error("{0}")] - GeneralError(#[from] anyhow::Error), - #[error("{0}")] - CsvError(#[from] csv::Error), - #[error("{0}")] - SerdeWasmBindgenError(#[from] serde_wasm_bindgen::Error), +#[error("{0}")] +pub struct CzvError(anyhow::Error); + +impl From for CzvError { + fn from(value: csv::Error) -> Self { + value.into() + } +} + +impl From for CzvError { + fn from(value: serde_wasm_bindgen::Error) -> Self { + value.into() + } } impl From for JsValue { diff --git a/czv-wasm/tests/count.rs b/czv-wasm/tests/count.rs index 7b04e7a..d0b8164 100644 --- a/czv-wasm/tests/count.rs +++ b/czv-wasm/tests/count.rs @@ -1,12 +1,12 @@ use czv_wasm; -use czv_wasm::count::{ColumnCountOptions, RowCountOptions}; +use czv_wasm::count::RowCountOptions; use czv_wasm::Result; use wasm_bindgen_test::*; wasm_bindgen_test::wasm_bindgen_test_configure!(run_in_browser); #[test] #[wasm_bindgen_test] -fn row_count_nonheader() -> Result<()> { +fn basic() -> Result<()> { let options = RowCountOptions { file_data: "fruit,price apple,2.00 @@ -19,34 +19,3 @@ 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(()) -} diff --git a/czv/Cargo.toml b/czv/Cargo.toml index 1fcb3e8..9ca4510 100644 --- a/czv/Cargo.toml +++ b/czv/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "czv" -version = "0.0.2" +version = "0.0.1" 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.5", features = ["html_reports"] } +criterion = { version = "0.4", features = ["html_reports"] } [[bench]] name = "benches" diff --git a/czv/README.md b/czv/README.md index 022987f..5b73a3c 100644 --- a/czv/README.md +++ b/czv/README.md @@ -5,7 +5,7 @@ Rust library for [czv](https://github.com/rzmk/czv). czv is a library of CSV-rel ## Links - czv GitHub repository: -- 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)) +- Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/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 - (http://www.apache.org/licenses/LICENSE-2.0) + ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) - MIT license - (http://opensource.org/licenses/MIT) + ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) at your option. diff --git a/czv/src/count.rs b/czv/src/count.rs index f84bb0b..d00cb33 100644 --- a/czv/src/count.rs +++ b/czv/src/count.rs @@ -207,7 +207,6 @@ impl< __file_path: typed_builder::Optional>, > ColumnCountBuilder<(__file_path, __file_data)> { - /// Returns the column count. pub fn execute(self) -> Result { let builder = self.__build(); column_count(builder.file_path, builder.file_data) diff --git a/czv/src/lib.rs b/czv/src/lib.rs index fcf36c8..d43d354 100644 --- a/czv/src/lib.rs +++ b/czv/src/lib.rs @@ -33,7 +33,7 @@ //! # Links //! //! - czv GitHub repository: -//! - 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)) +//! - Rust: [crates.io/crates/czv](https://crates.io/crates/czv) ([source code](https://github.com/rzmk/czv/tree/main/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 for CzvError { fn from(value: anyhow::Error) -> Self { - Self(value) + value.into() } } impl From for CzvError { fn from(value: csv::Error) -> Self { - Self(anyhow::anyhow!(value)) + value.into() } }