MCPcopy Create free account
hub / github.com/WeaveMindAI/weft / indent_code

Function indent_code

catalog/code/:exec/python/backend.rs:353–361  ·  view source on GitHub ↗
(code: &str, indent: &str)

Source from the content-addressed store, hash-verified

351}
352
353fn indent_code(code: &str, indent: &str) -> String {
354 if code.is_empty() {
355 return format!("{}pass", indent);
356 }
357 code.lines()
358 .map(|line| format!("{}{}", indent, line))
359 .collect::<Vec<_>>()
360 .join("\n")
361}
362
363/// Render a Rust string as a Python string literal, escaped safely.
364fn python_str_literal(s: &str) -> String {

Callers 1

build_user_blockFunction · 0.85

Calls 1

is_emptyMethod · 0.80

Tested by

no test coverage detected