mirror of
https://github.com/mii443/wasmer.git
synced 2025-08-24 09:19:25 +00:00
Simplifies a few pattern-matches
... which have a direct combinator equivalent on Option / Result. Tool-aided by [comby-rust](https://github.com/huitseeker/comby-rust).
This commit is contained in:
@ -57,10 +57,7 @@ impl SymbolRegistry for ShortNames {
|
||||
return None;
|
||||
}
|
||||
let (ty, idx) = name.split_at(1);
|
||||
let idx = match idx.parse::<u32>() {
|
||||
Ok(v) => v,
|
||||
Err(_) => return None,
|
||||
};
|
||||
let idx = idx.parse::<u32>().ok()?;
|
||||
match ty.chars().next().unwrap() {
|
||||
'f' => Some(Symbol::LocalFunction(LocalFunctionIndex::from_u32(idx))),
|
||||
's' => Some(Symbol::Section(SectionIndex::from_u32(idx))),
|
||||
|
Reference in New Issue
Block a user