mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-07 23:37:22 +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,6 +22,7 @@ mod offchain;
|
||||
|
||||
use self::changeset::OverlayedChangeSet;
|
||||
use crate::{backend::Backend, stats::StateMachineStats, BackendTransaction, DefaultError};
|
||||
use alloc::{collections::btree_set::BTreeSet, vec::Vec};
|
||||
use codec::{Decode, Encode};
|
||||
use hash_db::Hasher;
|
||||
pub use offchain::OffchainOverlayedChanges;
|
||||
@@ -31,12 +32,13 @@ use sp_core::{
|
||||
};
|
||||
#[cfg(feature = "std")]
|
||||
use sp_externalities::{Extension, Extensions};
|
||||
#[cfg(not(feature = "std"))]
|
||||
use sp_std::collections::btree_map::BTreeMap as Map;
|
||||
use sp_std::{collections::btree_set::BTreeSet, vec::Vec};
|
||||
use sp_trie::{empty_child_trie_root, LayoutV1};
|
||||
|
||||
#[cfg(not(feature = "std"))]
|
||||
use alloc::collections::btree_map::BTreeMap as Map;
|
||||
#[cfg(feature = "std")]
|
||||
use std::collections::{hash_map::Entry as MapEntry, HashMap as Map};
|
||||
|
||||
#[cfg(feature = "std")]
|
||||
use std::{
|
||||
any::{Any, TypeId},
|
||||
@@ -136,7 +138,7 @@ impl<H: Hasher> Clone for OverlayedChanges<H> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<H: Hasher> sp_std::fmt::Debug for OverlayedChanges<H> {
|
||||
impl<H: Hasher> core::fmt::Debug for OverlayedChanges<H> {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||
f.debug_struct("OverlayedChanges")
|
||||
.field("top", &self.top)
|
||||
@@ -259,7 +261,7 @@ impl<H: Hasher> Clone for StorageTransactionCache<H> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<H: Hasher> sp_std::fmt::Debug for StorageTransactionCache<H> {
|
||||
impl<H: Hasher> core::fmt::Debug for StorageTransactionCache<H> {
|
||||
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
|
||||
let mut debug = f.debug_struct("StorageTransactionCache");
|
||||
|
||||
@@ -572,7 +574,7 @@ impl<H: Hasher> OverlayedChanges<H> {
|
||||
},
|
||||
};
|
||||
|
||||
use sp_std::mem::take;
|
||||
use core::mem::take;
|
||||
let main_storage_changes = take(&mut self.top).drain_commited();
|
||||
let child_storage_changes = take(&mut self.children)
|
||||
.into_iter()
|
||||
@@ -777,7 +779,7 @@ where
|
||||
K: Ord,
|
||||
F: FnMut(&K, &mut V) -> bool,
|
||||
{
|
||||
let old = sp_std::mem::replace(map, Map::default());
|
||||
let old = core::mem::replace(map, Map::default());
|
||||
for (k, mut v) in old.into_iter() {
|
||||
if f(&k, &mut v) {
|
||||
map.insert(k, v);
|
||||
|
||||
Reference in New Issue
Block a user