luaur_reduce_cli/methods/reducer_escape.rs
1use alloc::string::String;
2
3use crate::records::reducer::Reducer;
4
5pub fn reducer_escape(this: &Reducer, s: &str) -> String {
6 let mut result = String::with_capacity(s.len() + 20);
7 result.push('"');
8
9 for c in s.chars() {
10 if c == '"' {
11 result.push('\\');
12 }
13 result.push(c);
14 }
15
16 result.push('"');
17 result
18}