From 4654b7c7fee5530fa48ffcc7f806f1b650e994e1 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Wed, 07 Sep 2022 13:56:08 +0000 Subject: [PATCH] fix(foreign-assets): use map_err --- --- a/pallets/foreign-assets/src/impl_fungibles.rs +++ b/pallets/foreign-assets/src/impl_fungibles.rs @@ -461,14 +461,10 @@ match asset { AssetIds::NativeAssetId(NativeCurrency::Here) => { - let this_amount: ::Balance = match value.try_into() { - Ok(val) => val, - Err(_) => { - return Err(DispatchError::Other( - "Bad amount to this parachain value conversion", - )) - } - }; + let this_amount: ::Balance = + value.try_into().map_err(|_| { + DispatchError::Other("Bad amount to this parachain value conversion") + })?; match as fungible::Mutate>::burn_from( who, -- gitstuff