json-forensics 0.1.1

A crate that adds a read adapter to deal with bad Python caused JSON payloads (NaNs and Infinities)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::io::{self, Read};
use std::str;

use json_forensics::translate_slice;

fn main() {
    let mut buffer = vec![];
    io::stdin().read_to_end(&mut buffer).unwrap();
    let old_buffer = buffer.clone();

    translate_slice(&mut buffer[..]);
    assert_eq!(str::from_utf8(&buffer[..]), str::from_utf8(&old_buffer[..]));
}