MCPcopy Create free account
hub / github.com/PerroEngine/Perro / rust_str_array

Function rust_str_array

perro_source/devtools/perro_cli/src/bench.rs:287–305  ·  view source on GitHub ↗
(values: &[String])

Source from the content-addressed store, hash-verified

285}
286
287fn rust_str_array(values: &[String]) -> String {
288 let mut out = String::from("&[");
289 for value in values {
290 out.push('"');
291 for ch in value.chars() {
292 match ch {
293 '\\' => out.push_str("\\\\"),
294 '"' => out.push_str("\\\""),
295 '\n' => out.push_str("\\n"),
296 '\r' => out.push_str("\\r"),
297 '\t' => out.push_str("\\t"),
298 c => out.push(c),
299 }
300 }
301 out.push_str("\",");
302 }
303 out.push(']');
304 out
305}
306
307fn normalize_toml_path(path: &Path) -> String {
308 let raw = path.to_string_lossy();

Callers 1

bench_harness_sourceFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected