Skip to content

Commit

Permalink
Add doc(cfg(feature = "std")) attribute where appropriate
Browse files Browse the repository at this point in the history
  • Loading branch information
jplatte committed Jul 27, 2021
1 parent d8f70a3 commit 6f15a0e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/de.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2492,6 +2492,7 @@ where
/// the JSON map or some number is too big to fit in the expected primitive
/// type.
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub fn from_reader<R, T>(rdr: R) -> Result<T>
where
R: crate::io::Read,
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ pub mod de;
pub mod error;
pub mod map;
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub mod ser;
#[cfg(not(feature = "std"))]
mod ser;
Expand Down
1 change: 1 addition & 0 deletions src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ where

/// JSON input source that reads from a std::io input stream.
#[cfg(feature = "std")]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub struct IoRead<R>
where
R: io::Read,
Expand Down
3 changes: 3 additions & 0 deletions src/ser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use serde::ser::{self, Impossible, Serialize};
use serde::serde_if_integer128;

/// A structure for serializing Rust values into JSON.
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub struct Serializer<W, F = CompactFormatter> {
writer: W,
formatter: F,
Expand Down Expand Up @@ -2141,6 +2142,7 @@ static ESCAPE: [u8; 256] = [
/// Serialization can fail if `T`'s implementation of `Serialize` decides to
/// fail, or if `T` contains a map with non-string keys.
#[inline]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub fn to_writer<W, T>(writer: W, value: &T) -> Result<()>
where
W: io::Write,
Expand All @@ -2159,6 +2161,7 @@ where
/// Serialization can fail if `T`'s implementation of `Serialize` decides to
/// fail, or if `T` contains a map with non-string keys.
#[inline]
#[cfg_attr(docsrs, doc(cfg(feature = "std")))]
pub fn to_writer_pretty<W, T>(writer: W, value: &T) -> Result<()>
where
W: io::Write,
Expand Down

0 comments on commit 6f15a0e

Please sign in to comment.