Crates.io | text-to-json |
lib.rs | text-to-json |
version | 0.1.3 |
source | src |
created_at | 2019-10-24 16:52:37.257686 |
updated_at | 2019-11-03 12:27:40.788404 |
description | Convert text to json in rust |
homepage | |
repository | https://github.com/adiatma/text-to-json.git |
max_upload_size | |
id | 175271 |
size | 5,928 |
Convert text to json in rust.
[dependencies]
text-to-json = "0.1.3"
Please check main.rs.
extern crate text_to_json;
use text_to_json::read;
fn main() {
match read::to_json(String::from("example.txt")) {
Ok(content) => println!("{:?}", content),
Err(_) => panic!("Error"),
}
}
Please check example.txt.
// output
["{\"title\":\"hello world\"}", "{\"description\":\"lorem ipsume sit amet dolor\"}", "{\"date\":\"1211121\"}"]