Skip to content

Commit

Permalink
Hide deprecations from docs
Browse files Browse the repository at this point in the history
This excludes deprecated enum variants, which must still be known for
exhaustiveness checking.
  • Loading branch information
jhpratt committed Dec 3, 2024
1 parent febf3a1 commit 98569ff
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 17 deletions.
1 change: 1 addition & 0 deletions time/src/duration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,7 @@ impl Duration {

/// Runs a closure, returning the duration of time it took to run. The return value of the
/// closure is provided in the second part of the tuple.
#[doc(hidden)]
#[cfg(feature = "std")]
#[deprecated(
since = "0.3.32",
Expand Down
13 changes: 0 additions & 13 deletions time/src/format_description/borrowed_format_item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,6 @@ use alloc::string::String;
#[cfg(feature = "alloc")]
use core::fmt;

/// A complete description of how to format and parse a type.
///
/// This alias exists for backwards-compatibility. It is recommended to use `BorrowedFormatItem`
/// for clarity, as it is more explicit that the data is borrowed rather than owned.
#[cfg(doc)]
#[deprecated(
since = "0.3.35",
note = "use `BorrowedFormatItem` instead for clarity"
)]
pub type FormatItem<'a> = BorrowedFormatItem<'a>;

#[cfg(not(doc))]
pub use self::BorrowedFormatItem as FormatItem;
use crate::error;
use crate::format_description::Component;

Expand Down
5 changes: 3 additions & 2 deletions time/src/format_description/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ mod owned_format_item;
mod parse;

pub use borrowed_format_item::BorrowedFormatItem;
#[allow(deprecated)]
pub use borrowed_format_item::FormatItem;
#[doc(hidden)]
#[deprecated(since = "0.3.37", note = "use `BorrowedFormatItem` for clarity")]
pub use borrowed_format_item::BorrowedFormatItem as FormatItem;
#[cfg(feature = "alloc")]
pub use owned_format_item::OwnedFormatItem;

Expand Down
1 change: 1 addition & 0 deletions time/src/instant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use crate::Duration;
///
/// This implementation allows for operations with signed [`Duration`]s, but is otherwise identical
/// to [`std::time::Instant`].
#[doc(hidden)]
#[deprecated(
since = "0.3.35",
note = "import `std::time::Instant` and `time::ext::InstantExt` instead"
Expand Down
5 changes: 3 additions & 2 deletions time/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
//!
//! - `serde`
//!
//! Enables [serde](https://docs.rs/serde) support for all types except [`Instant`].
//! Enables [serde](https://docs.rs/serde) support for all types.
//!
//! - `serde-human-readable` (_implicitly enables `serde`, `formatting`, and `parsing`_)
//!
Expand All @@ -58,7 +58,7 @@
//!
//! - `quickcheck` (_implicitly enables `alloc`_)
//!
//! Enables [quickcheck](https://docs.rs/quickcheck) support for all types except [`Instant`].
//! Enables [quickcheck](https://docs.rs/quickcheck) support for all types.
//!
//! - `wasm-bindgen`
//!
Expand Down Expand Up @@ -118,6 +118,7 @@ pub use time_core::convert;
pub use crate::date::Date;
pub use crate::duration::Duration;
pub use crate::error::Error;
#[doc(hidden)]
#[cfg(feature = "std")]
#[allow(deprecated)]
pub use crate::instant::Instant;
Expand Down

0 comments on commit 98569ff

Please sign in to comment.