topiary-core 0.7.3

Formats input source code in a style defined for that language.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use prettydiff::text::{ContextConfig, diff_lines};

pub fn pretty_assert_eq(v1: &str, v2: &str) {
    if v1 != v2 {
        let diff = diff_lines(v1, v2);
        panic!(
            "\n{}",
            diff.format_with_context(
                Some(ContextConfig {
                    context_size: 2,
                    skipping_marker: "...",
                }),
                true,
            )
        )
    }
}