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

Function split_revisioned_env_key

crates/openshell-core/src/secrets.rs:502–513  ·  view source on GitHub ↗
(key: &str)

Source from the content-addressed store, hash-verified

500}
501
502fn split_revisioned_env_key(key: &str) -> Option<(&str, &str)> {
503 let suffix = key.strip_prefix('v')?;
504 let (revision, env_key) = suffix.split_once('_')?;
505 if revision.is_empty()
506 || !revision.bytes().all(|b| b.is_ascii_digit())
507 || env_key.is_empty()
508 || !env_key.bytes().all(is_env_key_char)
509 {
510 return None;
511 }
512 Some((revision, env_key))
513}
514
515fn token_boundary_ok(text: &str, abs_start: usize, token_end: usize, token: &str) -> bool {
516 if token.starts_with(PLACEHOLDER_PREFIX) {

Calls 1

is_emptyMethod · 0.45

Tested by

no test coverage detected