Skip to main content

json_string

Function json_string 

Source
pub fn json_string(s: &str) -> String
Expand description

Re-exported so the shell can hand pointer/focus state and the window size in without depending on rux-style directly. Quote and escape s as a JSON string, per RFC 8259.

Lives beside Warning because both things that serialise one, the rux check CLI and the browser playground, need exactly this and nothing more. Two hand-rolled copies of an escaper is how the re-indenter went wrong. Windows paths carry backslashes and messages quote the author’s source, so both of those have to survive the trip into an editor.