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

Function dedup_strings

crates/openshell-cli/src/policy_update.rs:442–451  ·  view source on GitHub ↗
(values: &[String])

Source from the content-addressed store, hash-verified

440}
441
442fn dedup_strings(values: &[String]) -> Vec<String> {
443 let mut deduped = Vec::new();
444 for value in values {
445 let trimmed = value.trim();
446 if !trimmed.is_empty() && !deduped.iter().any(|existing| existing == trimmed) {
447 deduped.push(trimmed.to_string());
448 }
449 }
450 deduped
451}
452
453#[cfg(test)]
454mod tests {

Callers 1

build_policy_update_planFunction · 0.70

Calls 2

pushMethod · 0.80
is_emptyMethod · 0.45

Tested by

no test coverage detected