internals: Feature gate whole serde module

Instead of feature gating the individual code blocks just feature gate
the whole `serde` module.
This commit is contained in:
Tobin C. Harding 2024-06-20 13:59:57 +10:00
parent 9ddd7dacac
commit 4a2b13fcde
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
2 changed files with 1 additions and 3 deletions

View File

@ -26,4 +26,5 @@ pub mod const_tools;
pub mod error;
pub mod macros;
mod parse;
#[cfg(feature = "serde")]
pub mod serde;

View File

@ -1,6 +1,5 @@
//! Contains extensions of `serde` and internal reexports.
#[cfg(feature = "serde")]
#[doc(hidden)]
pub use serde::{de, ser, Deserialize, Deserializer, Serialize, Serializer};
@ -8,7 +7,6 @@ pub use serde::{de, ser, Deserialize, Deserializer, Serialize, Serializer};
///
/// This is used in [`Deserialize`] implementations to convert specialized errors into serde
/// errors.
#[cfg(feature = "serde")]
pub trait IntoDeError: Sized {
/// Converts to deserializer error possibly outputting vague message.
///
@ -28,7 +26,6 @@ pub trait IntoDeError: Sized {
}
}
#[cfg(feature = "serde")]
mod impls {
use super::*;