chore: move csv_path_p, restructure modules
This commit is contained in:
@ -4,6 +4,11 @@ use anyhow::{Context, Result};
|
||||
use csv::ReaderBuilder;
|
||||
use serde_json::Value;
|
||||
|
||||
pub fn csv_path_p(path: &Path) -> bool {
|
||||
path.extension()
|
||||
.is_some_and(|ext| ext.eq_ignore_ascii_case("csv"))
|
||||
}
|
||||
|
||||
/// Parse a CSV file and return records as serde_json::Value array
|
||||
pub fn parse_csv(path: &Path) -> Result<Vec<Value>> {
|
||||
let mut reader = ReaderBuilder::new()
|
||||
|
||||
Reference in New Issue
Block a user