~taiite/protodump

daf3516ebfe5e92acf50ca25596221738ac85600 — Hubert Hirtz 1 year, 5 months ago a1143a3
Compact header diff
1 files changed, 26 insertions(+), 17 deletions(-)

M src/main.rs
M src/main.rs => src/main.rs +26 -17
@@ 70,25 70,31 @@ impl PartialEq for ObjectInfo<'_> {

fn show_object_info_diff(prev: &ObjectInfo<'_>, next: &ObjectInfo<'_>) {
    if prev.container_type != next.container_type {
        println!("-Container type: {:?}", prev.container_type);
        println!("+Container type: {:?}", next.container_type);
    }
    if prev.is_little_endian != next.is_little_endian {
        println!(
            "-Endianness: {}",
            if prev.is_little_endian {
                "little"
            } else {
                "big"
            }
            "Container type: {} {}",
            Paint::red(format_args!("-{:?}", prev.container_type)),
            Paint::green(format_args!("+{:?}", next.container_type)),
        );
    }
    if prev.is_little_endian != next.is_little_endian {
        println!(
            "+Endianness: {}",
            if next.is_little_endian {
                "little"
            } else {
                "big"
            }
            "Endianness: {} {}",
            Paint::red(format_args!(
                "-{}",
                if prev.is_little_endian {
                    "little"
                } else {
                    "big"
                }
            )),
            Paint::green(format_args!(
                "+{}",
                if next.is_little_endian {
                    "little"
                } else {
                    "big"
                }
            )),
        );
    }
    // TODO show symbol whitelist diff?


@@ 483,7 489,10 @@ fn main() -> Result<()> {
        }

        let d = diff_sources(baseline_sources, sources);
        show_source_diff(&d);
        if !d.subprogram_diffs.is_empty() {
            println!();
            show_source_diff(&d);
        }
        is_match = is_match && d.subprogram_diffs.is_empty();

        if is_match {