MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / sanitize_docker_name

Function sanitize_docker_name

crates/openshell-driver-docker/src/lib.rs:3004–3017  ·  view source on GitHub ↗
(value: &str)

Source from the content-addressed store, hash-verified

3002}
3003
3004fn sanitize_docker_name(value: &str) -> String {
3005 value
3006 .chars()
3007 .map(|ch| {
3008 if ch.is_ascii_alphanumeric() || matches!(ch, '_' | '.' | '-') {
3009 ch.to_ascii_lowercase()
3010 } else {
3011 '-'
3012 }
3013 })
3014 .collect::<String>()
3015 .trim_matches('-')
3016 .to_string()
3017}
3018
3019fn normalize_docker_arch(arch: &str) -> String {
3020 match arch {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected