Replace get(..).unwrap() with indexing
This commit is contained in:
parent
f6e5ce39d2
commit
a1920fdcfa
@ -11,13 +11,7 @@ pub enum Location {
|
|||||||
impl Location {
|
impl Location {
|
||||||
pub fn addr(&self, symbol_tables: &SymbolTables) -> u32 {
|
pub fn addr(&self, symbol_tables: &SymbolTables) -> u32 {
|
||||||
match self {
|
match self {
|
||||||
Self::Symbol((table, sym)) => symbol_tables
|
Self::Symbol((table, sym)) => symbol_tables[table].symbols[sym].value(),
|
||||||
.get(table)
|
|
||||||
.unwrap()
|
|
||||||
.symbols
|
|
||||||
.get(sym)
|
|
||||||
.unwrap()
|
|
||||||
.value(),
|
|
||||||
Self::Address(addr) => *addr,
|
Self::Address(addr) => *addr,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -604,7 +604,7 @@ fn breakpoint_set_at(
|
|||||||
table
|
table
|
||||||
.breakpoints
|
.breakpoints
|
||||||
.iter()
|
.iter()
|
||||||
.map(|sym| table.symbols.get(sym).unwrap())
|
.map(|sym| &table.symbols[sym])
|
||||||
.any(|sym| sym.value() == addr)
|
.any(|sym| sym.value() == addr)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user