Skip to main content

csv_to_toml

Function csv_to_toml 

Source
pub fn csv_to_toml(csv: &str) -> Result<String, Box<dyn Error>>
Expand description

Converts CSV to TOML via the canonical hub.

The resulting TOML document is [[item]] array-of-tables, one item per CSV row.

§Errors

Returns an error if the CSV is malformed.

§Examples

use sheeter_engine::csv_to_toml;
let toml = csv_to_toml("a\n1\n").unwrap();
assert!(toml.contains("[[item]]"));