Crates.io | brittle |
lib.rs | brittle |
version | 0.1.1 |
source | src |
created_at | 2020-07-27 04:12:52.667936 |
updated_at | 2020-07-27 04:22:48.25787 |
description | Simple TOML parser in Rust |
homepage | |
repository | https://github.com/ZippyMagician/brittle |
max_upload_size | |
id | 269970 |
size | 29,072 |
A simple TOML parser written in Rust
Get started using this example here:
extern crate brittle;
use std::io;
use std::fs::File;
fn main() -> io::Result<()> {
let file = File::open("path/to/file.toml")?;
let buffer = io::BufReader::new(file);
let mut lines = buffer
.lines()
.map(|x| x.unwrap_or("".to_string()))
.collect::<Vec<String>>();
let result: Vec<brittle::Parser::TOML> = brittle::parse(lines.join("\n"));
// Do things with the result here
}
This was mainly created as an experiment, there are most likely much better crates available that are more useful. Feel free to use it, however! The other issue is the fact that there is no documentation. Sorry, maybe I'll consider adding some in the future
Brittle is licensed under the Apache-2.0 license.