pub fn array<F>(fmt: F) -> impl DisplayJson + DisplayExpand description
A convenience function for creating JSON arrays.
This is shorthand for json(|f| f.array(|f| fmt(f))), providing a more direct way
to construct JSON arrays without the extra nesting.
ยงExamples
let arr = nojson::array(|f| {
f.element(1)?;
f.element(2)?;
f.element(3)
});
assert_eq!(arr.to_string(), "[1,2,3]");