13 releases

0.1.14 Jan 10, 2025
0.1.12 Jan 10, 2025
0.1.10 Dec 17, 2024
0.1.1 Nov 15, 2024

#2411 in Parser implementations

Download history 46/week @ 2024-12-24 378/week @ 2025-01-07 36/week @ 2025-01-14 7/week @ 2025-01-21 16/week @ 2025-01-28 26/week @ 2025-02-04 31/week @ 2025-02-11 4/week @ 2025-02-18 6/week @ 2025-02-25 60/week @ 2025-03-04 16/week @ 2025-03-11 19/week @ 2025-03-18 65/week @ 2025-03-25 115/week @ 2025-04-01 151/week @ 2025-04-08

356 downloads per month

MIT/Apache

41KB
870 lines

Formats a given string so that serde_json crate can understand it.

Example 1

use serial_test::serial;
use json_string::prepare_json_string;

let original_str = r#"
    [
        {"tag":"lol", "groups":[]}
    ]
"#;
let prepared_str = prepare_json_string(original_str);

let expected_str = r#"[{"tag": "lol"}]"#;

assert_eq!(prepared_str, expected_str);

Example 2

use serial_test::serial;
use json_string::prepare_json_string;

let original_str = r#"
    [
        {"label":"lol", "customtags": {"k1": "v1"}}
    ]
"#;
let prepared_str = prepare_json_string(original_str);

let expected_str = r#"[{"label": "lol", "customtags": {"k1": "v1"}}]"#;

assert_eq!(prepared_str, expected_str);

Dependencies

~3.5–10MB
~99K SLoC