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

Function sanitize_file_stem

perro_editor/res/scripts/scene/editor_animation.rs:333–345  ·  view source on GitHub ↗
(text: &str)

Source from the content-addressed store, hash-verified

331 out.push_str(&text[pos..]);
332 return out;
333 }
334 format!("{text}\n[Frame0]\n{block}[/Frame0]\n")
335}
336
337pub fn sanitize_file_stem(text: &str) -> String {
338 let out = text
339 .chars()
340 .map(|ch| {
341 if ch.is_ascii_alphanumeric() || ch == '_' || ch == '-' {
342 ch
343 } else {
344 '_'
345 }
346 })
347 .collect::<String>();
348 out.trim_matches('_').to_ascii_lowercase()

Callers 4

duplicate_res_targetFunction · 0.85
rename_res_targetFunction · 0.85
glb_asset_stemFunction · 0.85
quick_asset_stemFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected