Skip to main content

assert_contains_not

Function assert_contains_not 

Source
pub fn assert_contains_not<H, N>(needle: N, haystack: H)
where H: Container + Debug, N: Borrow<H::Item>, H::Item: Debug,
Expand description

Assert that a haystack does not contain the given needle.

Uses the Container abstraction so it works with slices, vectors, sets, maps (by key), strings, and ranges. The error message includes both the container and the item for quick debugging.

ยงPanics

Panics if haystack.contains(needle) returns true.