Macro serde_json_lodash::concat
source · [−]macro_rules! concat {
() => { ... };
($a:expr $(,)*) => { ... };
($a:expr, $b:expr $(,)*) => { ... };
($a:expr, $b:expr, $($rest:tt)*) => { ... };
}
Expand description
Based on concat()
Examples:
#[macro_use] extern crate serde_json_lodash;
use serde_json::json;
let array = json!([1]);
assert_eq!(
array,
json!([1])
);
let other = concat!(array, json!(2), json!([3]), json!([[4]]));
assert_eq!(
other,
json!([1, 2, 3, [4]])
);
More examples:
assert_eq!(concat!(), json!([]));
assert_eq!(concat!(json!(null)), json!([null]));
assert_eq!(concat!(json!(false)), json!([false]));
assert_eq!(concat!(json!(0)), json!([0]));
assert_eq!(concat!(json!("")), json!([""]));
assert_eq!(concat!(json!([])), json!([]));
assert_eq!(concat!(json!(null),json!(null)), json!([null,null]));