text-to-json

Crates.iotext-to-json
lib.rstext-to-json
version0.1.3
sourcesrc
created_at2019-10-24 16:52:37.257686
updated_at2019-11-03 12:27:40.788404
descriptionConvert text to json in rust
homepage
repositoryhttps://github.com/adiatma/text-to-json.git
max_upload_size
id175271
size5,928
Adiatma Kamarudin (adiatma)

documentation

README

text-to-json

Convert text to json in rust.

Install

[dependencies]
text-to-json = "0.1.3"

How to use?

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\"}"]
Commit count: 0

cargo fmt