mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-12 08:45:42 +00:00
cargo +nightly fmt (#3540)
* cargo +nightly fmt * add cargo-fmt check to ci * update ci * fmt * fmt * skip macro * ignore bridges
This commit is contained in:
@@ -15,8 +15,7 @@
|
||||
// along with Polkadot. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
use quote::quote;
|
||||
use syn::Result;
|
||||
use syn::spanned::Spanned;
|
||||
use syn::{spanned::Spanned, Result};
|
||||
|
||||
use super::*;
|
||||
|
||||
@@ -30,21 +29,24 @@ pub(crate) fn impl_message_wrapper_enum(info: &OverseerInfo) -> Result<proc_macr
|
||||
let message_wrapper = &info.message_wrapper;
|
||||
|
||||
let (outgoing_from_impl, outgoing_decl) = if let Some(outgoing) = outgoing {
|
||||
let outgoing_variant = outgoing
|
||||
.get_ident()
|
||||
.ok_or_else(||{
|
||||
syn::Error::new(outgoing.span(), "Missing identifier to use as enum variant for outgoing.")
|
||||
})?;
|
||||
(quote! {
|
||||
impl ::std::convert::From< #outgoing > for #message_wrapper {
|
||||
fn from(message: #outgoing) -> Self {
|
||||
#message_wrapper :: #outgoing_variant ( message )
|
||||
let outgoing_variant = outgoing.get_ident().ok_or_else(|| {
|
||||
syn::Error::new(
|
||||
outgoing.span(),
|
||||
"Missing identifier to use as enum variant for outgoing.",
|
||||
)
|
||||
})?;
|
||||
(
|
||||
quote! {
|
||||
impl ::std::convert::From< #outgoing > for #message_wrapper {
|
||||
fn from(message: #outgoing) -> Self {
|
||||
#message_wrapper :: #outgoing_variant ( message )
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
quote! {
|
||||
#outgoing_variant ( #outgoing ) ,
|
||||
})
|
||||
},
|
||||
quote! {
|
||||
#outgoing_variant ( #outgoing ) ,
|
||||
},
|
||||
)
|
||||
} else {
|
||||
(TokenStream::new(), TokenStream::new())
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user