MCPcopy Create free account
hub / github.com/Work-Fisher/code-claw / push_unicode_escape

Function push_unicode_escape

claw-code/rust/crates/runtime/src/json.rs:135–144  ·  view source on GitHub ↗
(rendered: &mut String, control: char)

Source from the content-addressed store, hash-verified

133}
134
135fn push_unicode_escape(rendered: &mut String, control: char) {
136 const HEX: &[u8; 16] = b"0123456789abcdef";
137
138 rendered.push_str("\\u");
139 let value = u32::from(control);
140 for shift in [12_u32, 8, 4, 0] {
141 let nibble = ((value >> shift) & 0xF) as usize;
142 rendered.push(char::from(HEX[nibble]));
143 }
144}
145
146struct Parser<'a> {
147 chars: Vec<char>,

Callers 1

render_stringFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected