Replace get(..).unwrap() with indexing

This commit is contained in:
pjht 2022-10-18 19:14:28 -05:00
parent f6e5ce39d2
commit a1920fdcfa
2 changed files with 2 additions and 8 deletions

View File

@ -11,13 +11,7 @@ pub enum Location {
impl Location {
pub fn addr(&self, symbol_tables: &SymbolTables) -> u32 {
match self {
Self::Symbol((table, sym)) => symbol_tables
.get(table)
.unwrap()
.symbols
.get(sym)
.unwrap()
.value(),
Self::Symbol((table, sym)) => symbol_tables[table].symbols[sym].value(),
Self::Address(addr) => *addr,
}
}

View File

@ -604,7 +604,7 @@ fn breakpoint_set_at(
table
.breakpoints
.iter()
.map(|sym| table.symbols.get(sym).unwrap())
.map(|sym| &table.symbols[sym])
.any(|sym| sym.value() == addr)
})
}