*: Replace _serde with dep:serde in Cargo.toml (#2868)

This commit is contained in:
Alexander Shishenko 2022-09-08 11:30:43 +03:00 committed by GitHub
parent 83c67954e9
commit c650dc19db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 5 additions and 14 deletions

View File

@ -37,7 +37,7 @@ thiserror = "1.0"
unsigned-varint = "0.7" unsigned-varint = "0.7"
void = "1" void = "1"
zeroize = "1" zeroize = "1"
_serde = { package = "serde", version = "1", optional = true, features = ["derive"] } serde = { version = "1", optional = true, features = ["derive"] }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies] [target.'cfg(not(target_arch = "wasm32"))'.dependencies]
ring = { version = "0.16.9", features = ["alloc", "std"], default-features = false, optional = true} ring = { version = "0.16.9", features = ["alloc", "std"], default-features = false, optional = true}
@ -63,7 +63,7 @@ default = [ "secp256k1", "ecdsa" ]
secp256k1 = [ "libsecp256k1" ] secp256k1 = [ "libsecp256k1" ]
ecdsa = [ "p256" ] ecdsa = [ "p256" ]
rsa = [ "dep:ring" ] rsa = [ "dep:ring" ]
serde = ["multihash/serde-codec", "_serde"] serde = ["multihash/serde-codec", "dep:serde"]
[[bench]] [[bench]]
name = "peer_id" name = "peer_id"

View File

@ -35,9 +35,6 @@
//! define how to upgrade each individual substream to use a protocol. //! define how to upgrade each individual substream to use a protocol.
//! See the `upgrade` module. //! See the `upgrade` module.
#[cfg(feature = "serde")]
extern crate _serde as serde;
#[allow(clippy::derive_partial_eq_without_eq)] #[allow(clippy::derive_partial_eq_without_eq)]
mod keys_proto { mod keys_proto {
include!(concat!(env!("OUT_DIR"), "/keys_proto.rs")); include!(concat!(env!("OUT_DIR"), "/keys_proto.rs"));

View File

@ -183,7 +183,7 @@ impl From<PeerId> for Vec<u8> {
impl Serialize for PeerId { impl Serialize for PeerId {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where where
S: _serde::Serializer, S: serde::Serializer,
{ {
if serializer.is_human_readable() { if serializer.is_human_readable() {
serializer.serialize_str(&self.to_base58()) serializer.serialize_str(&self.to_base58())

View File

@ -4,8 +4,6 @@ use std::str::FromStr;
use libp2p_core::PeerId; use libp2p_core::PeerId;
extern crate _serde as serde;
#[test] #[test]
pub fn serialize_peer_id_json() { pub fn serialize_peer_id_json() {
let peer_id = PeerId::from_str("12D3KooWRNw2pJC9748Fmq4WNV27HoSTcX3r37132FLkQMrbKAiC").unwrap(); let peer_id = PeerId::from_str("12D3KooWRNw2pJC9748Fmq4WNV27HoSTcX3r37132FLkQMrbKAiC").unwrap();

View File

@ -29,7 +29,7 @@ unsigned-varint = { version = "0.7", features = ["asynchronous_codec"] }
void = "1.0" void = "1.0"
futures-timer = "3.0.2" futures-timer = "3.0.2"
instant = "0.1.11" instant = "0.1.11"
_serde = { package = "serde", version = "1.0", optional = true, features = ["derive"] } serde = { version = "1.0", optional = true, features = ["derive"] }
thiserror = "1" thiserror = "1"
[dev-dependencies] [dev-dependencies]
@ -43,4 +43,4 @@ quickcheck = "0.9.0"
prost-build = "0.11" prost-build = "0.11"
[features] [features]
serde = ["_serde", "bytes/serde"] serde = ["dep:serde", "bytes/serde"]

View File

@ -39,9 +39,6 @@
// be useful later for record store // be useful later for record store
#![allow(dead_code)] #![allow(dead_code)]
#[cfg(feature = "serde")]
extern crate _serde as serde;
pub mod handler; pub mod handler;
pub mod kbucket; pub mod kbucket;
pub mod protocol; pub mod protocol;

View File

@ -32,7 +32,6 @@ use std::hash::{Hash, Hasher};
/// The (opaque) key of a record. /// The (opaque) key of a record.
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "serde", serde(crate = "_serde"))]
#[derive(Clone, Debug, PartialEq, Eq, Hash)] #[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub struct Key(Bytes); pub struct Key(Bytes);