Skip to content

Commit 1b57859

Browse files
committed
Run doctests with alloc feature if possible
1 parent 6f2c7cc commit 1b57859

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/format/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
//!
1818
//! # Example
1919
//! ```
20-
//! # #[cfg(feature = "std")] {
20+
//! # #[cfg(feature = "alloc")] {
2121
//! use chrono::{NaiveDateTime, TimeZone, Utc};
2222
//!
2323
//! let date_time = Utc.with_ymd_and_hms(2020, 11, 10, 0, 1, 32).unwrap();

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@
385385
//! to get the number of additional number of nanoseconds.
386386
//!
387387
//! ```
388-
//! # #[cfg(feature = "std")] {
388+
//! # #[cfg(feature = "alloc")] {
389389
//! // We need the trait in scope to use Utc::timestamp().
390390
//! use chrono::{DateTime, Utc};
391391
//!

src/naive/time/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ impl Timelike for NaiveTime {
949949
/// Use the proper [formatting method](#method.format) to get a human-readable representation.
950950
///
951951
/// ```
952-
/// # #[cfg(feature = "std")] {
952+
/// # #[cfg(feature = "alloc")] {
953953
/// # use chrono::{NaiveTime, Timelike};
954954
/// let leap = NaiveTime::from_hms_milli_opt(23, 59, 59, 1_000).unwrap();
955955
/// assert_eq!(leap.second(), 59);
@@ -982,7 +982,7 @@ impl Timelike for NaiveTime {
982982
/// use the proper [formatting method](#method.format) to get a human-readable representation.
983983
///
984984
/// ```
985-
/// # #[cfg(feature = "std")] {
985+
/// # #[cfg(feature = "alloc")] {
986986
/// # use chrono::{NaiveTime, Timelike};
987987
/// let leap = NaiveTime::from_hms_milli_opt(23, 59, 59, 1_000).unwrap();
988988
/// assert_eq!(leap.nanosecond(), 1_000_000_000);

src/offset/fixed.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ impl FixedOffset {
5050
/// # Example
5151
///
5252
/// ```
53-
/// # #[cfg(feature = "std")] {
53+
/// # #[cfg(feature = "alloc")] {
5454
/// use chrono::{FixedOffset, TimeZone};
5555
/// let hour = 3600;
5656
/// let datetime =
@@ -85,7 +85,7 @@ impl FixedOffset {
8585
/// # Example
8686
///
8787
/// ```
88-
/// # #[cfg(feature = "std")] {
88+
/// # #[cfg(feature = "alloc")] {
8989
/// use chrono::{FixedOffset, TimeZone};
9090
/// let hour = 3600;
9191
/// let datetime =

0 commit comments

Comments
 (0)