~taiite/protodump

20217bed02fa3ab291f79a9122982ae30a41967b — Hubert Hirtz 2 years ago 13d78fa
Replace let-else statements for compatibility
2 files changed, 18 insertions(+), 7 deletions(-)

M src/dwarf.rs
M src/main.rs
M src/dwarf.rs => src/dwarf.rs +8 -3
@@ 259,9 259,14 @@ where
                    continue;
                }

                let Some(name) = entry_name(dwarf, &unit, entry)? else { continue };
                let Some(address) = entry_address_attr(entry, gimli::DW_AT_low_pc)?
                    else { continue };
                let name = match entry_name(dwarf, &unit, entry)? {
                    Some(v) => v,
                    None => continue,
                };
                let address = match entry_address_attr(entry, gimli::DW_AT_low_pc)? {
                    Some(v) => v,
                    None => continue,
                };
                let typ = entry_type(&mut type_cache, &unit, entry)?;
                let mut parameters = Vec::new();


M src/main.rs => src/main.rs +10 -4
@@ 459,10 459,13 @@ fn main() -> Result<()> {
    let object_info = read_object_info(&obj, symbol_filter)?;

    sources.subprograms.retain(|func, subprogram| {
        let Some(symbol_address) = object_info
        let symbol_address = match object_info
            .symbol_whitelist
            .get(func.to_string_lossy().as_ref())
            else { return false };
        {
            Some(v) => v,
            None => return false,
        };
        *symbol_address == subprogram.address
    });



@@ 486,10 489,13 @@ fn main() -> Result<()> {
        let baseline_object_info = read_object_info(&baseline_obj, symbol_filter)?;

        baseline_sources.subprograms.retain(|func, subprogram| {
            let Some(symbol_address) = baseline_object_info
            let symbol_address = match baseline_object_info
                .symbol_whitelist
                .get(func.to_string_lossy().as_ref())
                else { return false };
            {
                Some(v) => v,
                None => return false,
            };
            *symbol_address == subprogram.address
        });