A no_std, zero-copy, allocation-free library for streaming JSON string escaping and unescaping. Ergonomic, fast, RFC 8259 compliant, with layered APIs for iterators, I/O streaming, and low-level tokens.
//! Basic unescaping from a string slice into a `String`.
usejson_escape::unescape;usestd::borrow::Cow;fnmain(){let input =r#"Emoji: \uD83D\uDE00 and a tab\t!"#;let expected ="Emoji: 😀 and a tab\t!";// `unescape` returns an iterator over Result<&[u8], _>.
// `.decode_utf8()` collects and validates into a `Cow<str>`.
let decoded:Cow<str>=unescape(input).decode_utf8().unwrap();assert_eq!(decoded, expected);println!("Unescaped string: {}", decoded);}