Function assert_json_matches_no_panic

Source
pub fn assert_json_matches_no_panic<Lhs, Rhs>(
    lhs: &Lhs,
    rhs: &Rhs,
    config: Config,
) -> Result<(), Vec<DifferenceBuf>>
where Lhs: Serialize, Rhs: Serialize,
Expand description

Compares two JSON values without panicking.

Returns a Result containing either Ok(()) if the values match, or an Err with a Vec<DifferenceBuf> describing the differences.

ยงNote:

This function performs some cloning and may be less efficient.

If you only need a string error message, use assert_json_matches_no_panic_to_string or the assertion macros.