mirror of
https://github.com/fluencelabs/marine-rs-sdk-test
synced 2024-12-04 15:20:18 +00:00
get rid of unwrap
This commit is contained in:
parent
79d7e181ee
commit
9839e54383
@ -50,12 +50,17 @@ impl ParseMacroInput for syn::ItemForeignMod {
|
||||
.into_iter()
|
||||
.filter_map(|attr| attr.parse_meta().ok())
|
||||
.filter(|meta| meta.path().is_ident(LINK_DIRECTIVE_NAME))
|
||||
.filter_map(|meta| match meta {
|
||||
syn::Meta::List(meta_list) => Some(meta_list),
|
||||
_ => None,
|
||||
.filter_map(|meta| {
|
||||
let pair = match meta {
|
||||
syn::Meta::List(mut meta_list) if meta_list.nested.len() == 1 => {
|
||||
meta_list.nested.pop().unwrap()
|
||||
}
|
||||
_ => return None,
|
||||
};
|
||||
Some(pair.into_tuple().0)
|
||||
})
|
||||
.filter_map(|meta_list| match meta_list.nested.first().unwrap() {
|
||||
syn::NestedMeta::Meta(meta) => Some(meta.clone()),
|
||||
.filter_map(|nested| match nested {
|
||||
syn::NestedMeta::Meta(meta) => Some(meta),
|
||||
_ => None,
|
||||
})
|
||||
.filter(|meta| meta.path().is_ident(WASM_IMPORT_MODULE_DIRECTIVE_NAME))
|
||||
|
Loading…
Reference in New Issue
Block a user