MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / has_duplicates

Function has_duplicates

crates/chat-cli/src/cli/chat/tools/todo.rs:477–483  ·  view source on GitHub ↗

Generated by Q

(vec: &[T])

Source from the content-addressed store, hash-verified

475
476/// Generated by Q
477fn has_duplicates<T>(vec: &[T]) -> bool
478where
479 T: std::hash::Hash + Eq,
480{
481 let mut seen = HashSet::with_capacity(vec.len());
482 vec.iter().any(|item| !seen.insert(item))
483}

Callers 1

validateMethod · 0.85

Calls 2

insertMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected