Just use serde as a feature directly

poc-serde-support
James Munns 5 years ago
parent c5a757fb60
commit 6b0a81012b

@ -33,15 +33,11 @@ default = [
"mio-uds", "mio-uds",
"num_cpus", "num_cpus",
"pin-project-lite", "pin-project-lite",
"serde-support", "serde",
] ]
docs = ["attributes", "unstable"] docs = ["attributes", "unstable"]
unstable = ["default", "broadcaster"] unstable = ["default", "broadcaster"]
attributes = ["async-attributes"] attributes = ["async-attributes"]
serde-support = [
"default",
"serde",
]
std = [ std = [
"async-macros", "async-macros",
"crossbeam-utils", "crossbeam-utils",

@ -13,16 +13,16 @@ use crate::path::Path;
use crate::prelude::*; use crate::prelude::*;
#[cfg(feature = "unstable")] #[cfg(feature = "unstable")]
use crate::stream::{self, FromStream, IntoStream}; use crate::stream::{self, FromStream, IntoStream};
#[cfg(feature = "serde-support")] #[cfg(feature = "serde")]
use serde::{Serialize, Deserialize}; use serde::{Serialize, Deserialize};
/// This struct is an async version of [`std::path::PathBuf`]. /// This struct is an async version of [`std::path::PathBuf`].
/// ///
/// [`std::path::Path`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html /// [`std::path::Path`]: https://doc.rust-lang.org/std/path/struct.PathBuf.html
#[cfg_attr(feature = "serde-support", derive(Serialize, Deserialize))] #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(Clone, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub struct PathBuf { pub struct PathBuf {
#[cfg_attr(feature = "serde-support", serde(flatten))] #[cfg_attr(feature = "serde", serde(flatten))]
inner: std::path::PathBuf, inner: std::path::PathBuf,
} }

Loading…
Cancel
Save