Macro assertables::assure_set_eq [−][src]
macro_rules! assure_set_eq { ($left:expr, $right:expr $(,)?) => { ... }; ($left:expr, $right:expr, $($arg:tt)+) => { ... }; }
Expand description
Assure two sets are equal.
-
When true, return
Ok(true). -
When false, return
Ok(false). -
Otherwise, return
Errwith a message and the values of the expressions with their debug representations.
Example
let x = assure_set_eq!([1, 2], [2, 1]); //-> Ok(true)
let x = assure_set_eq!([1, 2], [3, 4]); //-> Ok(false)
This macro has a second form where a custom message can be provided.
This implementation uses [HashSet] to count items.