difftreelog
fix serde no_std usage
in: master
6 files changed
pallets/inflation/Cargo.tomldiffbeforeafterboth--- a/pallets/inflation/Cargo.toml
+++ b/pallets/inflation/Cargo.toml
@@ -19,7 +19,7 @@
version = '2.0.0'
[dependencies]
-serde = { version = "1.0.119" }
+serde = { default-features = false, version = "1.0.119", features = ["derive"] }
frame-support = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
frame-system = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
pallet-balances = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
pallets/inflation/src/lib.rsdiffbeforeafterboth--- a/pallets/inflation/src/lib.rs
+++ b/pallets/inflation/src/lib.rs
@@ -10,8 +10,7 @@
#[cfg(feature = "std")]
pub use std::*;
-#[cfg(feature = "std")]
-pub use serde::*;
+pub use serde::{Serialize, Deserialize};
#[cfg(feature = "runtime-benchmarks")]
mod benchmarking;
pallets/nft/Cargo.tomldiffbeforeafterboth--- a/pallets/nft/Cargo.toml
+++ b/pallets/nft/Cargo.toml
@@ -19,7 +19,7 @@
version = '2.0.0'
[dependencies]
-serde = { version = "1.0.119" }
+serde = { default-features = false, version = "1.0.119", features = ["derive"] }
frame-support = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
frame-system = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
pallet-balances = { default-features = false, version = '3.0.0', git = "https://github.com/paritytech/substrate.git", branch = "frontier" }
pallets/nft/src/eth/account.rsdiffbeforeafterboth2use codec::{Encode, EncodeLike, Decode};2use codec::{Encode, EncodeLike, Decode};3use sp_core::{H160, H256, crypto::AccountId32};3use sp_core::{H160, H256, crypto::AccountId32};4use core::cmp::Ordering;4use core::cmp::Ordering;5#[cfg(feature = "std")]6use serde::{Serialize, Deserialize};5use serde::{Serialize, Deserialize};7use pallet_evm::AddressMapping;6use pallet_evm::AddressMapping;8use sp_std::vec::Vec;7use sp_std::vec::Vec;21}20}222123#[derive(Eq)]22#[derive(Eq)]24#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]23#[derive(Serialize, Deserialize)]25pub struct BasicCrossAccountId<T: Config> {24pub struct BasicCrossAccountId<T: Config> {26 /// If true - then ethereum is canonical encoding25 /// If true - then ethereum is canonical encoding27 from_ethereum: bool,26 from_ethereum: bool,pallets/nft/src/lib.rsdiffbeforeafterboth--- a/pallets/nft/src/lib.rs
+++ b/pallets/nft/src/lib.rs
@@ -7,9 +7,9 @@
#![cfg_attr(not(feature = "std"), no_std)]
-#[cfg(feature = "std")]
-pub use serde::*;
+pub use serde::{Serialize, Deserialize};
+
use core::ops::{Deref, DerefMut};
use codec::{Decode, Encode};
pub use frame_support::{
@@ -71,7 +71,7 @@
pub type DecimalPoints = u8;
#[derive(Encode, Decode, Eq, Debug, Clone, PartialEq)]
-#[cfg_attr(feature = "std", derive(Serialize, Deserialize))]
+#[derive(Serialize, Deserialize)]
pub enum CollectionMode {
Invalid,
NFT,
pallets/nft/src/types.rsdiffbeforeafterboth--- a/pallets/nft/src/types.rs
+++ b/pallets/nft/src/types.rs
@@ -1,8 +1,7 @@
#[cfg(feature = "std")]
pub use std::*;
-#[cfg(feature = "std")]
-pub use serde::*;
+pub use serde::{Serealize, Deserialize};
use codec::{Decode, Encode};