Flexibly Parse a JSON string
Add this to your Cargo.toml
:
toml
[dependencies]
json_flex = "*"
and this to your crate root:
rust
extern crate json_flex;
use json_flex::{JFObject, Unwrap};
```rust extern crate json_flex;
use json_flex::{JFObject, Unwrap};
fn main() { let array = jsonflex::decode(r#"[1,2,3,4]"#.toowned()); println!("{:?}", array); println!("{:?}", array.to_json());
let array = json_flex::decode(r#"["1","2","3","4"]"#.to_owned());
println!("{:?}", array[0].into_string());
println!("{:?}", array.to_json());
} ```
JsonFlex is released under the MIT License.