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