From 7d2c9fc3f869cf2346f13c592453f3a0359413ff Mon Sep 17 00:00:00 2001 From: Paul Dicker Date: Thu, 21 Sep 2023 21:00:41 +0200 Subject: [PATCH] Switch docs.rs to `auto_docs_cfg` --- src/date.rs | 4 --- src/datetime/mod.rs | 40 --------------------------- src/datetime/rustc_serialize.rs | 4 --- src/datetime/serde.rs | 3 -- src/format/formatting.rs | 7 ----- src/format/mod.rs | 3 -- src/format/strftime.rs | 1 - src/lib.rs | 9 +----- src/month.rs | 2 -- src/naive/date.rs | 6 ---- src/naive/datetime/mod.rs | 2 -- src/naive/datetime/rustc_serialize.rs | 2 -- src/naive/datetime/serde.rs | 2 -- src/naive/mod.rs | 1 - src/naive/time/mod.rs | 2 -- src/naive/time/rustc_serialize.rs | 2 -- src/naive/time/serde.rs | 2 -- src/offset/utc.rs | 1 - src/round.rs | 1 - src/weekday.rs | 2 -- 20 files changed, 1 insertion(+), 95 deletions(-) diff --git a/src/date.rs b/src/date.rs index 5e846923..6cbe851f 100644 --- a/src/date.rs +++ b/src/date.rs @@ -334,7 +334,6 @@ where { /// Formats the date with the specified formatting items. #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] #[inline] #[must_use] pub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat @@ -349,7 +348,6 @@ where /// See the [`crate::format::strftime`] module /// on the supported escape sequences. #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] #[inline] #[must_use] pub fn format<'a>(&self, fmt: &'a str) -> DelayedFormat> { @@ -358,7 +356,6 @@ where /// Formats the date with the specified formatting items and locale. #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] #[inline] #[must_use] pub fn format_localized_with_items<'a, I, B>( @@ -383,7 +380,6 @@ where /// See the [`crate::format::strftime`] module /// on the supported escape sequences. #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] #[inline] #[must_use] pub fn format_localized<'a>( diff --git a/src/datetime/mod.rs b/src/datetime/mod.rs index 633913b8..12e26602 100644 --- a/src/datetime/mod.rs +++ b/src/datetime/mod.rs @@ -537,7 +537,6 @@ impl DateTime { /// Panics if the date can not be represented in this format: the year may not be negative and /// can not have more than 4 digits. #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] #[must_use] pub fn to_rfc2822(&self) -> String { let mut result = String::with_capacity(32); @@ -548,7 +547,6 @@ impl DateTime { /// Returns an RFC 3339 and ISO 8601 date and time string such as `1996-12-19T16:39:57-08:00`. #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] #[must_use] pub fn to_rfc3339(&self) -> String { // For some reason a string with a capacity less than 32 is ca 20% slower when benchmarking. @@ -585,7 +583,6 @@ impl DateTime { /// "2018-01-26T10:30:09+08:00"); /// ``` #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] #[must_use] pub fn to_rfc3339_opts(&self, secform: SecondsFormat, use_z: bool) -> String { let mut result = String::with_capacity(38); @@ -647,7 +644,6 @@ impl Default for DateTime { } #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl Default for DateTime { fn default() -> Self { Local.from_utc_datetime(&NaiveDateTime::default()) @@ -673,7 +669,6 @@ impl From> for DateTime { /// Convert a `DateTime` instance into a `DateTime` instance. #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl From> for DateTime { /// Convert this `DateTime` instance into a `DateTime` instance. /// @@ -696,7 +691,6 @@ impl From> for DateTime { /// Convert a `DateTime` instance into a `DateTime` instance. #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl From> for DateTime { /// Convert this `DateTime` instance into a `DateTime` instance. /// @@ -709,7 +703,6 @@ impl From> for DateTime { /// Convert a `DateTime` instance into a `DateTime` instance. #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl From> for DateTime { /// Convert this `DateTime` instance into a `DateTime` instance. /// @@ -722,7 +715,6 @@ impl From> for DateTime { /// Convert a `DateTime` instance into a `DateTime` instance. #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl From> for DateTime { /// Convert this `DateTime` instance into a `DateTime` instance. /// @@ -868,7 +860,6 @@ where { /// Formats the combined date and time with the specified formatting items. #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] #[inline] #[must_use] pub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat @@ -893,7 +884,6 @@ where /// assert_eq!(formatted, "02/04/2017 12:50"); /// ``` #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] #[inline] #[must_use] pub fn format<'a>(&self, fmt: &'a str) -> DelayedFormat> { @@ -902,7 +892,6 @@ where /// Formats the combined date and time with the specified formatting items and locale. #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] #[inline] #[must_use] pub fn format_localized_with_items<'a, I, B>( @@ -930,7 +919,6 @@ where /// See the [`crate::format::strftime`] module on the supported escape /// sequences. #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] #[inline] #[must_use] pub fn format_localized<'a>( @@ -1401,7 +1389,6 @@ impl str::FromStr for DateTime { /// # Ok::<(), chrono::ParseError>(()) /// ``` #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl str::FromStr for DateTime { type Err = ParseError; @@ -1411,7 +1398,6 @@ impl str::FromStr for DateTime { } #[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl From for DateTime { fn from(t: SystemTime) -> DateTime { let (sec, nsec) = match t.duration_since(UNIX_EPOCH) { @@ -1432,7 +1418,6 @@ impl From for DateTime { } #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl From for DateTime { fn from(t: SystemTime) -> DateTime { DateTime::::from(t).with_timezone(&Local) @@ -1440,7 +1425,6 @@ impl From for DateTime { } #[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl From> for SystemTime { fn from(dt: DateTime) -> SystemTime { let sec = dt.timestamp(); @@ -1459,14 +1443,6 @@ impl From> for SystemTime { feature = "wasmbind", not(any(target_os = "emscripten", target_os = "wasi")) ))] -#[cfg_attr( - docsrs, - doc(cfg(all( - target_arch = "wasm32", - feature = "wasmbind", - not(any(target_os = "emscripten", target_os = "wasi")) - ))) -)] impl From for DateTime { fn from(date: js_sys::Date) -> DateTime { DateTime::::from(&date) @@ -1478,14 +1454,6 @@ impl From for DateTime { feature = "wasmbind", not(any(target_os = "emscripten", target_os = "wasi")) ))] -#[cfg_attr( - docsrs, - doc(cfg(all( - target_arch = "wasm32", - feature = "wasmbind", - not(any(target_os = "emscripten", target_os = "wasi")) - ))) -)] impl From<&js_sys::Date> for DateTime { fn from(date: &js_sys::Date) -> DateTime { Utc.timestamp_millis_opt(date.get_time() as i64).unwrap() @@ -1497,14 +1465,6 @@ impl From<&js_sys::Date> for DateTime { feature = "wasmbind", not(any(target_os = "emscripten", target_os = "wasi")) ))] -#[cfg_attr( - docsrs, - doc(cfg(all( - target_arch = "wasm32", - feature = "wasmbind", - not(any(target_os = "emscripten", target_os = "wasi")) - ))) -)] impl From> for js_sys::Date { /// Converts a `DateTime` to a JS `Date`. The resulting value may be lossy, /// any values that have a millisecond timestamp value greater/less than ±8,640,000,000,000,000 diff --git a/src/datetime/rustc_serialize.rs b/src/datetime/rustc_serialize.rs index 115ec9eb..51ef5b72 100644 --- a/src/datetime/rustc_serialize.rs +++ b/src/datetime/rustc_serialize.rs @@ -1,5 +1,3 @@ -#![cfg_attr(docsrs, doc(cfg(feature = "rustc-serialize")))] - use super::{DateTime, SecondsFormat}; #[cfg(feature = "clock")] use crate::offset::Local; @@ -82,7 +80,6 @@ impl Decodable for TsSeconds { } #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl Decodable for DateTime { fn decode(d: &mut D) -> Result, D::Error> { match d.read_str()?.parse::>() { @@ -93,7 +90,6 @@ impl Decodable for DateTime { } #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] #[allow(deprecated)] impl Decodable for TsSeconds { #[allow(deprecated)] diff --git a/src/datetime/serde.rs b/src/datetime/serde.rs index 4044eb58..85655c99 100644 --- a/src/datetime/serde.rs +++ b/src/datetime/serde.rs @@ -1,5 +1,3 @@ -#![cfg_attr(docsrs, doc(cfg(feature = "serde")))] - use core::fmt; use serde::{de, ser}; @@ -107,7 +105,6 @@ impl<'de> de::Deserialize<'de> for DateTime { /// See [the `serde` module](./serde/index.html) for alternate /// serialization formats. #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl<'de> de::Deserialize<'de> for DateTime { fn deserialize(deserializer: D) -> Result where diff --git a/src/format/formatting.rs b/src/format/formatting.rs index bf37ba51..f456f10e 100644 --- a/src/format/formatting.rs +++ b/src/format/formatting.rs @@ -46,7 +46,6 @@ use locales::*; /// A *temporary* object which can be used as an argument to `format!` or others. /// This is normally constructed via `format` methods of each date and time type. #[cfg(any(feature = "alloc", feature = "std"))] -#[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] #[derive(Debug)] pub struct DelayedFormat { /// The date view, if any. @@ -103,7 +102,6 @@ impl<'a, I: Iterator + Clone, B: Borrow>> DelayedFormat { /// Makes a new `DelayedFormat` value out of local date and time and locale. #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] #[must_use] pub fn new_with_locale( date: Option, @@ -116,7 +114,6 @@ impl<'a, I: Iterator + Clone, B: Borrow>> DelayedFormat { /// Makes a new `DelayedFormat` value out of local date and time, UTC offset and locale. #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] #[must_use] pub fn new_with_offset_and_locale( date: Option, @@ -157,7 +154,6 @@ impl<'a, I: Iterator + Clone, B: Borrow>> fmt::Display for De /// Tries to format given arguments with given formatting items. /// Internally used by `DelayedFormat`. #[cfg(any(feature = "alloc", feature = "std"))] -#[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] pub fn format<'a, I, B>( w: &mut fmt::Formatter, date: Option<&NaiveDate>, @@ -177,7 +173,6 @@ where } /// Formats single formatting item #[cfg(any(feature = "alloc", feature = "std"))] -#[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] pub fn format_item( w: &mut fmt::Formatter, date: Option<&NaiveDate>, @@ -193,7 +188,6 @@ pub fn format_item( /// Tries to format given arguments with given formatting items. /// Internally used by `DelayedFormat`. #[cfg(feature = "unstable-locales")] -#[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] pub fn format_localized<'a, I, B>( w: &mut fmt::Formatter, date: Option<&NaiveDate>, @@ -215,7 +209,6 @@ where /// Formats single formatting item #[cfg(feature = "unstable-locales")] -#[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] pub fn format_item_localized( w: &mut fmt::Formatter, date: Option<&NaiveDate>, diff --git a/src/format/mod.rs b/src/format/mod.rs index d22cdf07..6ee0837e 100644 --- a/src/format/mod.rs +++ b/src/format/mod.rs @@ -333,13 +333,11 @@ pub enum Item<'a> { Literal(&'a str), /// Same as `Literal` but with the string owned by the item. #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] OwnedLiteral(Box), /// Whitespace. Prints literally but reads zero or more whitespace. Space(&'a str), /// Same as `Space` but with the string owned by the item. #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] OwnedSpace(Box), /// Numeric item. Can be optionally padded to the maximal length (if any) when formatting; /// the parser simply ignores any padded whitespace and zeroes. @@ -437,7 +435,6 @@ impl fmt::Display for ParseError { } #[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl Error for ParseError { #[allow(deprecated)] fn description(&self) -> &str { diff --git a/src/format/strftime.rs b/src/format/strftime.rs index d7551457..a72e6353 100644 --- a/src/format/strftime.rs +++ b/src/format/strftime.rs @@ -191,7 +191,6 @@ impl<'a> StrftimeItems<'a> { /// Creates a new parsing iterator from the `strftime`-like format string. #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] #[must_use] pub const fn new_with_locale(s: &'a str, locale: Locale) -> StrftimeItems<'a> { StrftimeItems { remainder: s, queue: &[], locale_str: "", locale: Some(locale) } diff --git a/src/lib.rs b/src/lib.rs index 11179f91..c91bc067 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -469,7 +469,7 @@ // can remove this if/when rustc-serialize support is removed // keeps clippy happy in the meantime #![cfg_attr(feature = "rustc-serialize", allow(deprecated))] -#![cfg_attr(docsrs, feature(doc_cfg))] +#![cfg_attr(docsrs, feature(doc_auto_cfg))] #[cfg(feature = "alloc")] extern crate alloc; @@ -487,11 +487,9 @@ pub mod prelude { #[allow(deprecated)] pub use crate::Date; #[cfg(feature = "clock")] - #[cfg_attr(docsrs, doc(cfg(feature = "clock")))] #[doc(no_inline)] pub use crate::Local; #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] #[doc(no_inline)] pub use crate::Locale; #[doc(no_inline)] @@ -514,7 +512,6 @@ pub use date::{Date, MAX_DATE, MIN_DATE}; mod datetime; #[cfg(feature = "rustc-serialize")] -#[cfg_attr(docsrs, doc(cfg(feature = "rustc-serialize")))] pub use datetime::rustc_serialize::TsSeconds; #[allow(deprecated)] pub use datetime::{DateTime, SecondsFormat, MAX_DATETIME, MIN_DATETIME}; @@ -522,7 +519,6 @@ pub use datetime::{DateTime, SecondsFormat, MAX_DATETIME, MIN_DATETIME}; pub mod format; /// L10n locales. #[cfg(feature = "unstable-locales")] -#[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] pub use format::Locale; pub use format::{ParseError, ParseResult}; @@ -532,7 +528,6 @@ pub use naive::{Days, IsoWeek, NaiveDate, NaiveDateTime, NaiveTime, NaiveWeek}; pub mod offset; #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] #[doc(no_inline)] pub use offset::Local; #[doc(no_inline)] @@ -564,7 +559,6 @@ pub use naive::__BenchYearFlags; /// [1]: https://tools.ietf.org/html/rfc3339 /// [2]: https://serde.rs/field-attrs.html#with #[cfg(feature = "serde")] -#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] pub mod serde { pub use super::datetime::serde::*; } @@ -573,7 +567,6 @@ pub mod serde { /// /// This module re-exports the `Archived*` versions of chrono's types. #[cfg(feature = "rkyv")] -#[cfg_attr(docsrs, doc(cfg(feature = "rkyv")))] pub mod rkyv { pub use crate::datetime::ArchivedDateTime; pub use crate::duration::ArchivedDuration; diff --git a/src/month.rs b/src/month.rs index 146a98eb..abe33740 100644 --- a/src/month.rs +++ b/src/month.rs @@ -236,7 +236,6 @@ pub struct ParseMonthError { } #[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl std::error::Error for ParseMonthError {} impl fmt::Display for ParseMonthError { @@ -252,7 +251,6 @@ impl fmt::Debug for ParseMonthError { } #[cfg(feature = "serde")] -#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] mod month_serde { use super::Month; use serde::{de, ser}; diff --git a/src/naive/date.rs b/src/naive/date.rs index 677c5fa6..d2a91f18 100644 --- a/src/naive/date.rs +++ b/src/naive/date.rs @@ -1265,7 +1265,6 @@ impl NaiveDate { /// assert_eq!(format!("{}", d.format_with_items(fmt)), "2015-09-05"); /// ``` #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] #[inline] #[must_use] pub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat @@ -1309,7 +1308,6 @@ impl NaiveDate { /// assert_eq!(format!("{}", d.format("%A, %-d %B, %C%y")), "Saturday, 5 September, 2015"); /// ``` #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] #[inline] #[must_use] pub fn format<'a>(&self, fmt: &'a str) -> DelayedFormat> { @@ -1318,7 +1316,6 @@ impl NaiveDate { /// Formats the date with the specified formatting items and locale. #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] #[inline] #[must_use] pub fn format_localized_with_items<'a, I, B>( @@ -1338,7 +1335,6 @@ impl NaiveDate { /// See the [`crate::format::strftime`] module on the supported escape /// sequences. #[cfg(feature = "unstable-locales")] - #[cfg_attr(docsrs, doc(cfg(feature = "unstable-locales")))] #[inline] #[must_use] pub fn format_localized<'a>( @@ -2276,7 +2272,6 @@ where } #[cfg(feature = "rustc-serialize")] -#[cfg_attr(docsrs, doc(cfg(feature = "rustc-serialize")))] mod rustc_serialize { use super::NaiveDate; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; @@ -2311,7 +2306,6 @@ mod rustc_serialize { } #[cfg(feature = "serde")] -#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] mod serde { use super::NaiveDate; use core::fmt; diff --git a/src/naive/datetime/mod.rs b/src/naive/datetime/mod.rs index db974c48..79b8ab73 100644 --- a/src/naive/datetime/mod.rs +++ b/src/naive/datetime/mod.rs @@ -894,7 +894,6 @@ impl NaiveDateTime { /// assert_eq!(format!("{}", dt.format_with_items(fmt)), "2015-09-05 23:56:04"); /// ``` #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] #[inline] #[must_use] pub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat @@ -938,7 +937,6 @@ impl NaiveDateTime { /// assert_eq!(format!("{}", dt.format("around %l %p on %b %-d")), "around 11 PM on Sep 5"); /// ``` #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] #[inline] #[must_use] pub fn format<'a>(&self, fmt: &'a str) -> DelayedFormat> { diff --git a/src/naive/datetime/rustc_serialize.rs b/src/naive/datetime/rustc_serialize.rs index 201fe7aa..d2b8a871 100644 --- a/src/naive/datetime/rustc_serialize.rs +++ b/src/naive/datetime/rustc_serialize.rs @@ -1,5 +1,3 @@ -#![cfg_attr(docsrs, doc(cfg(feature = "rustc-serialize")))] - use super::NaiveDateTime; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; use std::ops::Deref; diff --git a/src/naive/datetime/serde.rs b/src/naive/datetime/serde.rs index 86d8b20f..0a6cfd91 100644 --- a/src/naive/datetime/serde.rs +++ b/src/naive/datetime/serde.rs @@ -1,5 +1,3 @@ -#![cfg_attr(docsrs, doc(cfg(feature = "serde")))] - use core::fmt; use serde::{de, ser}; diff --git a/src/naive/mod.rs b/src/naive/mod.rs index 044e7540..c8c281b0 100644 --- a/src/naive/mod.rs +++ b/src/naive/mod.rs @@ -34,7 +34,6 @@ pub use self::internals::YearFlags as __BenchYearFlags; /// [1]: https://serde.rs/attributes.html#field-attributes /// [2]: https://tools.ietf.org/html/rfc3339 #[cfg(feature = "serde")] -#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] pub mod serde { pub use super::datetime::serde::*; } diff --git a/src/naive/time/mod.rs b/src/naive/time/mod.rs index da35a496..8bc5e957 100644 --- a/src/naive/time/mod.rs +++ b/src/naive/time/mod.rs @@ -778,7 +778,6 @@ impl NaiveTime { /// assert_eq!(format!("{}", t.format_with_items(fmt)), "23:56:04"); /// ``` #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] #[inline] #[must_use] pub fn format_with_items<'a, I, B>(&self, items: I) -> DelayedFormat @@ -824,7 +823,6 @@ impl NaiveTime { /// assert_eq!(format!("{}", t.format("%-I:%M %p")), "11:56 PM"); /// ``` #[cfg(any(feature = "alloc", feature = "std"))] - #[cfg_attr(docsrs, doc(cfg(any(feature = "alloc", feature = "std"))))] #[inline] #[must_use] pub fn format<'a>(&self, fmt: &'a str) -> DelayedFormat> { diff --git a/src/naive/time/rustc_serialize.rs b/src/naive/time/rustc_serialize.rs index 128fcec8..3c5c47a1 100644 --- a/src/naive/time/rustc_serialize.rs +++ b/src/naive/time/rustc_serialize.rs @@ -1,5 +1,3 @@ -#![cfg_attr(docsrs, doc(cfg(feature = "rustc-serialize")))] - use super::NaiveTime; use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; diff --git a/src/naive/time/serde.rs b/src/naive/time/serde.rs index cf3c4e3d..0992fb59 100644 --- a/src/naive/time/serde.rs +++ b/src/naive/time/serde.rs @@ -1,5 +1,3 @@ -#![cfg_attr(docsrs, doc(cfg(feature = "serde")))] - use super::NaiveTime; use core::fmt; use serde::{de, ser}; diff --git a/src/offset/utc.rs b/src/offset/utc.rs index d27f7877..17e575a5 100644 --- a/src/offset/utc.rs +++ b/src/offset/utc.rs @@ -46,7 +46,6 @@ use crate::{Date, DateTime}; pub struct Utc; #[cfg(feature = "clock")] -#[cfg_attr(docsrs, doc(cfg(feature = "clock")))] impl Utc { /// Returns a `Date` which corresponds to the current date. #[deprecated( diff --git a/src/round.rs b/src/round.rs index 9c0e76a0..795ffb04 100644 --- a/src/round.rs +++ b/src/round.rs @@ -291,7 +291,6 @@ impl fmt::Display for RoundingError { } #[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl std::error::Error for RoundingError { #[allow(deprecated)] fn description(&self) -> &str { diff --git a/src/weekday.rs b/src/weekday.rs index a7abd941..e3c241ae 100644 --- a/src/weekday.rs +++ b/src/weekday.rs @@ -227,7 +227,6 @@ pub struct ParseWeekdayError { } #[cfg(feature = "std")] -#[cfg_attr(docsrs, doc(cfg(feature = "std")))] impl std::error::Error for ParseWeekdayError {} impl fmt::Display for ParseWeekdayError { @@ -245,7 +244,6 @@ impl fmt::Debug for ParseWeekdayError { // the actual `FromStr` implementation is in the `format` module to leverage the existing code #[cfg(feature = "serde")] -#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] mod weekday_serde { use super::Weekday; use core::fmt;