From 786d0f38bad5b90bdc820149549b991648bbf080 Mon Sep 17 00:00:00 2001 From: rzmk <30333942+rzmk@users.noreply.github.com> Date: Thu, 20 Jun 2024 16:47:39 -0400 Subject: [PATCH] docs: use top-level `RowCount` & show types --- README.md | 9 +++------ czv/examples/simple_row_count.rs | 6 +++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cd92230..409e8bc 100644 --- a/README.md +++ b/README.md @@ -23,17 +23,14 @@ cargo install czv use czv::{RowCount, Result}; fn main() -> Result<()> { - let data = "\ + let data: &str = "\ fruits,price apple,2.50 banana,3.00 strawberry,1.50 "; - let output = 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(()) } ``` diff --git a/czv/examples/simple_row_count.rs b/czv/examples/simple_row_count.rs index b002dab..88ea23c 100644 --- a/czv/examples/simple_row_count.rs +++ b/czv/examples/simple_row_count.rs @@ -1,13 +1,13 @@ -use czv::{count::RowCount, Result}; +use czv::{Result, RowCount}; fn main() -> Result<()> { - let data = "\ + let data: &str = "\ fruits,price apple,2.50 banana,3.00 strawberry,1.50 "; - let output = RowCount::new().file_data(data).execute()?; + let output: usize = RowCount::new().file_data(data).execute()?; println!("{output}"); // 3 Ok(()) }