Skip to main content

is_empty

Function is_empty 

Source
pub fn is_empty() -> EmptyMatcher
Expand description

Matches an empty container.

T can be any container that implements IntoIterator. For instance, T can be the reference of a common container like &Vec and &HashSet.

let value: Vec<i32> = vec![];
verify_that!(value, is_empty())?;
let value: HashSet<i32> = HashSet::new();
verify_that!(value, is_empty())?;
let value: &[u32] = &[];
verify_that!(value, is_empty())?;