mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
sp-std removal from substrate/primitives (#3274)
This PR removes sp-std crate from substrate/primitives sub-directories. For now crates that have `pub use` of sp-std or export macros that would necessitate users of the macros to `extern crate alloc` have been excluded from this PR. There should be no breaking changes in this PR. --------- Co-authored-by: Koute <koute@users.noreply.github.com>
This commit is contained in:
@@ -22,7 +22,6 @@ impl-serde = { version = "0.4.0", optional = true, default-features = false }
|
||||
ref-cast = "1.0.0"
|
||||
serde = { features = ["alloc", "derive"], optional = true, workspace = true }
|
||||
sp-debug-derive = { path = "../debug-derive", default-features = false }
|
||||
sp-std = { path = "../std", default-features = false }
|
||||
|
||||
[features]
|
||||
default = ["std"]
|
||||
@@ -31,7 +30,6 @@ std = [
|
||||
"impl-serde/std",
|
||||
"serde/std",
|
||||
"sp-debug-derive/std",
|
||||
"sp-std/std",
|
||||
]
|
||||
|
||||
# Serde support without relying on std features.
|
||||
|
||||
@@ -19,18 +19,19 @@
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
|
||||
use core::fmt::Display;
|
||||
extern crate alloc;
|
||||
|
||||
#[cfg(feature = "serde")]
|
||||
use serde::{Deserialize, Serialize};
|
||||
use sp_debug_derive::RuntimeDebug;
|
||||
|
||||
use alloc::vec::Vec;
|
||||
use codec::{Decode, Encode};
|
||||
use ref_cast::RefCast;
|
||||
use sp_std::{
|
||||
use core::{
|
||||
fmt::Display,
|
||||
ops::{Deref, DerefMut},
|
||||
vec::Vec,
|
||||
};
|
||||
use ref_cast::RefCast;
|
||||
|
||||
/// Storage key.
|
||||
#[derive(PartialEq, Eq, RuntimeDebug)]
|
||||
@@ -49,9 +50,7 @@ impl AsRef<[u8]> for StorageKey {
|
||||
}
|
||||
|
||||
/// Storage key with read/write tracking information.
|
||||
#[derive(
|
||||
PartialEq, Eq, Ord, PartialOrd, sp_std::hash::Hash, RuntimeDebug, Clone, Encode, Decode,
|
||||
)]
|
||||
#[derive(PartialEq, Eq, Ord, PartialOrd, core::hash::Hash, RuntimeDebug, Clone, Encode, Decode)]
|
||||
pub struct TrackedStorageKey {
|
||||
pub key: Vec<u8>,
|
||||
pub reads: u32,
|
||||
@@ -441,7 +440,7 @@ impl From<StateVersion> for u8 {
|
||||
|
||||
impl TryFrom<u8> for StateVersion {
|
||||
type Error = ();
|
||||
fn try_from(val: u8) -> sp_std::result::Result<StateVersion, ()> {
|
||||
fn try_from(val: u8) -> core::result::Result<StateVersion, ()> {
|
||||
match val {
|
||||
0 => Ok(StateVersion::V0),
|
||||
1 => Ok(StateVersion::V1),
|
||||
|
||||
Reference in New Issue
Block a user