convert2json 2.2.1

CLI utilities to convert BSON, CBOR, CSV, INI, MessagePack, Plist, RSV, TOML, XML & YAML into JSON and for use with jaq or jq.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#![cfg(any(feature = "toml", feature = "toml2json", feature = "tq"))]
use super::{exit, Error};
use std::io::{read_to_string, Read};

pub fn from_reader<R: Read>(reader: R) -> String {
    match read_to_string(reader) {
        Ok(data) => data,
        Err(e) => {
            eprintln!("Error reading input: {e}");
            exit(Error::InputReading as i32);
        }
    }
}