Macro serde_json_lodash::intersection_x
source · [−]macro_rules! intersection_x {
() => { ... };
($a:expr $(,)*) => { ... };
($a:expr, $b:expr $(,)*) => { ... };
($a:expr, $b:expr, $($rest:tt)*) => { ... };
}
Expand description
Based on intersection_x()
Examples:
#[macro_use] extern crate serde_json_lodash;
use serde_json::json;
assert_eq!(
intersection_x!(json!([2, 1]), json!([2, 3])),
vec![json!(2)]
);
More examples:
let expect: Vec<Value> = vec![];
assert_eq!(intersection_x!(), expect);
assert_eq!(intersection_x!(json!([3, 2, 1]), json!([2, 3, 4]), json!([3, 2, 0])), vec![json!(3), json!(2)])