json-escape 0.1.0

A high-performance, `no_std` library for streaming JSON string escaping and unescaping. Process large JSON strings with zero-copy slicing and no intermediate allocations, ideal for parsers and memory-constrained environments.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::env;
use std::process::Command;

fn main() {
    // Get the rustc version
    let rustc = env::var("RUSTC").unwrap_or_else(|_| "rustc".to_string());
    let output = Command::new(rustc).arg("--version").output().unwrap();
    let version = String::from_utf8(output.stdout).unwrap();

    println!("cargo:rustc-check-cfg=cfg(nightly)");

    // Check if the version string contains "-nightly"
    if version.contains("-nightly") {
        println!("cargo:rustc-cfg=feature=\"simd\"");
        println!("cargo:rustc-cfg=nightly");
    }
}