Skip to content

Commit

Permalink
Run doctests with alloc feature if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
pitdicker committed Mar 22, 2024
1 parent 6f2c7cc commit 1b57859
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/format/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//!
//! # Example
//! ```
//! # #[cfg(feature = "std")] {
//! # #[cfg(feature = "alloc")] {
//! use chrono::{NaiveDateTime, TimeZone, Utc};
//!
//! let date_time = Utc.with_ymd_and_hms(2020, 11, 10, 0, 1, 32).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@
//! to get the number of additional number of nanoseconds.
//!
//! ```
//! # #[cfg(feature = "std")] {
//! # #[cfg(feature = "alloc")] {
//! // We need the trait in scope to use Utc::timestamp().
//! use chrono::{DateTime, Utc};
//!
Expand Down
4 changes: 2 additions & 2 deletions src/naive/time/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ impl Timelike for NaiveTime {
/// Use the proper [formatting method](#method.format) to get a human-readable representation.
///
/// ```
/// # #[cfg(feature = "std")] {
/// # #[cfg(feature = "alloc")] {
/// # use chrono::{NaiveTime, Timelike};
/// let leap = NaiveTime::from_hms_milli_opt(23, 59, 59, 1_000).unwrap();
/// assert_eq!(leap.second(), 59);
Expand Down Expand Up @@ -982,7 +982,7 @@ impl Timelike for NaiveTime {
/// use the proper [formatting method](#method.format) to get a human-readable representation.
///
/// ```
/// # #[cfg(feature = "std")] {
/// # #[cfg(feature = "alloc")] {
/// # use chrono::{NaiveTime, Timelike};
/// let leap = NaiveTime::from_hms_milli_opt(23, 59, 59, 1_000).unwrap();
/// assert_eq!(leap.nanosecond(), 1_000_000_000);
Expand Down
4 changes: 2 additions & 2 deletions src/offset/fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ impl FixedOffset {
/// # Example
///
/// ```
/// # #[cfg(feature = "std")] {
/// # #[cfg(feature = "alloc")] {
/// use chrono::{FixedOffset, TimeZone};
/// let hour = 3600;
/// let datetime =
Expand Down Expand Up @@ -85,7 +85,7 @@ impl FixedOffset {
/// # Example
///
/// ```
/// # #[cfg(feature = "std")] {
/// # #[cfg(feature = "alloc")] {
/// use chrono::{FixedOffset, TimeZone};
/// let hour = 3600;
/// let datetime =
Expand Down

0 comments on commit 1b57859

Please sign in to comment.