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

Function is_valid_env_key

crates/openshell-server/src/grpc/provider.rs:1104–1113  ·  view source on GitHub ↗
(key: &str)

Source from the content-addressed store, hash-verified

1102}
1103
1104pub(super) fn is_valid_env_key(key: &str) -> bool {
1105 let mut bytes = key.bytes();
1106 let Some(first) = bytes.next() else {
1107 return false;
1108 };
1109 if !(first == b'_' || first.is_ascii_alphabetic()) {
1110 return false;
1111 }
1112 bytes.all(|byte| byte == b'_' || byte.is_ascii_alphanumeric())
1113}
1114
1115// ---------------------------------------------------------------------------
1116// Trait impls for persistence

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected