mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 09:17:58 +00:00
sp-std -> core (#3199)
First in a series of PRs that reduces our use of sp-std with a view to deprecating it. This is just looking at /substrate and moving some of the references from `sp-std` to `core`. These particular changes should be uncontroversial. Where macros are used `::core` should be used to remove any ambiguity. part of https://github.com/paritytech/polkadot-sdk/issues/2101
This commit is contained in:
@@ -178,7 +178,7 @@ pub fn expand_outer_dispatch(
|
||||
type PostInfo = #scrate::dispatch::PostDispatchInfo;
|
||||
fn dispatch(self, origin: RuntimeOrigin) -> #scrate::dispatch::DispatchResultWithPostInfo {
|
||||
if !<Self::RuntimeOrigin as #scrate::traits::OriginTrait>::filter_call(&origin, &self) {
|
||||
return #scrate::__private::sp_std::result::Result::Err(
|
||||
return ::core::result::Result::Err(
|
||||
#system_path::Error::<#runtime>::CallFiltered.into()
|
||||
);
|
||||
}
|
||||
|
||||
@@ -134,7 +134,6 @@ pub fn expand_outer_enum(
|
||||
enum_ty,
|
||||
));
|
||||
enum_conversions.extend(expand_enum_conversion(
|
||||
scrate,
|
||||
pallet_decl,
|
||||
&pallet_enum,
|
||||
&enum_name_ident,
|
||||
@@ -220,7 +219,6 @@ fn expand_enum_variant(
|
||||
}
|
||||
|
||||
fn expand_enum_conversion(
|
||||
scrate: &TokenStream,
|
||||
pallet: &Pallet,
|
||||
pallet_enum: &TokenStream,
|
||||
enum_name_ident: &Ident,
|
||||
@@ -247,7 +245,7 @@ fn expand_enum_conversion(
|
||||
impl TryInto<#pallet_enum> for #enum_name_ident {
|
||||
type Error = ();
|
||||
|
||||
fn try_into(self) -> #scrate::__private::sp_std::result::Result<#pallet_enum, Self::Error> {
|
||||
fn try_into(self) -> ::core::result::Result<#pallet_enum, Self::Error> {
|
||||
match self {
|
||||
Self::#variant_name(evt) => Ok(evt),
|
||||
_ => Err(()),
|
||||
|
||||
@@ -304,7 +304,7 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
#[doc(hidden)]
|
||||
#[codec(skip)]
|
||||
__Ignore(
|
||||
#frame_support::__private::sp_std::marker::PhantomData<(#type_use_gen,)>,
|
||||
::core::marker::PhantomData<(#type_use_gen,)>,
|
||||
#frame_support::Never,
|
||||
),
|
||||
#(
|
||||
|
||||
@@ -87,7 +87,7 @@ pub fn expand_event(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
#[doc(hidden)]
|
||||
#[codec(skip)]
|
||||
__Ignore(
|
||||
#frame_support::__private::sp_std::marker::PhantomData<(#event_use_gen)>,
|
||||
::core::marker::PhantomData<(#event_use_gen)>,
|
||||
#frame_support::Never,
|
||||
)
|
||||
);
|
||||
|
||||
@@ -171,7 +171,7 @@ impl CompositeDef {
|
||||
#[doc(hidden)]
|
||||
#[codec(skip)]
|
||||
__Ignore(
|
||||
#scrate::__private::sp_std::marker::PhantomData<I>,
|
||||
::core::marker::PhantomData<I>,
|
||||
)
|
||||
});
|
||||
}
|
||||
|
||||
@@ -623,7 +623,7 @@ fn generate_storage_instance(
|
||||
|
||||
quote! {
|
||||
#visibility struct #counter_name< #impl_generics >(
|
||||
#crate_::__private::sp_std::marker::PhantomData<(#type_generics)>
|
||||
::core::marker::PhantomData<(#type_generics)>
|
||||
) #where_clause;
|
||||
|
||||
impl<#impl_generics> #crate_::traits::StorageInstance
|
||||
@@ -653,7 +653,7 @@ fn generate_storage_instance(
|
||||
let code = quote! {
|
||||
#[allow(non_camel_case_types)]
|
||||
#visibility struct #name< #impl_generics >(
|
||||
#crate_::__private::sp_std::marker::PhantomData<(#type_generics)>
|
||||
::core::marker::PhantomData<(#type_generics)>
|
||||
) #where_clause;
|
||||
|
||||
impl<#impl_generics> #crate_::traits::StorageInstance
|
||||
|
||||
Reference in New Issue
Block a user