Skip to content

Commit

Permalink
Fix CI failure
Browse files Browse the repository at this point in the history
  • Loading branch information
jhpratt committed Dec 3, 2024
1 parent 8b50f04 commit 0943997
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 9 deletions.
4 changes: 0 additions & 4 deletions tests/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,6 @@ macro_rules! require_all_features {
}

require_all_features! {
// Required by the crate for technical reasons.
#[allow(clippy::single_component_path_imports)]
use rstest_reuse;

/// Construct a non-exhaustive modifier.
macro_rules! modifier {
($name:ident $({
Expand Down
5 changes: 4 additions & 1 deletion tests/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ use time::{util, Month};
#[case(2020, November, 30)]
#[case(2020, December, 31)]
fn days_in_year_month(#[case] year: i32, #[case] month: Month, #[case] expected: u8) {
assert_eq!(util::days_in_year_month(year, month), expected);
#[allow(deprecated)]
{
assert_eq!(util::days_in_year_month(year, month), expected);
}
}

#[rstest]
Expand Down
2 changes: 1 addition & 1 deletion time/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub use time_macros::datetime;
/// );
/// # Ok::<_, time::Error>(())
/// ```
///
///
/// The syntax accepted by this macro is the same as [`format_description::parse()`], which can
/// be found in [the book](https://time-rs.github.io/book/api/format-description.html).
///
Expand Down
12 changes: 9 additions & 3 deletions time/src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,9 @@ impl Time {
/// time!(01:02:03.004_005_006).replace_millisecond(7),
/// Ok(time!(01:02:03.007))
/// );
/// assert!(time!(01:02:03.004_005_006).replace_millisecond(1_000).is_err()); // 1_000 isn't a valid millisecond
/// assert!(time!(01:02:03.004_005_006)
/// .replace_millisecond(1_000)
/// .is_err()); // 1_000 isn't a valid millisecond
/// ```
#[must_use = "This method does not mutate the original `Time`."]
pub const fn replace_millisecond(
Expand All @@ -680,7 +682,9 @@ impl Time {
/// time!(01:02:03.004_005_006).replace_microsecond(7_008),
/// Ok(time!(01:02:03.007_008))
/// );
/// assert!(time!(01:02:03.004_005_006).replace_microsecond(1_000_000).is_err()); // 1_000_000 isn't a valid microsecond
/// assert!(time!(01:02:03.004_005_006)
/// .replace_microsecond(1_000_000)
/// .is_err()); // 1_000_000 isn't a valid microsecond
/// ```
#[must_use = "This method does not mutate the original `Time`."]
pub const fn replace_microsecond(
Expand All @@ -700,7 +704,9 @@ impl Time {
/// time!(01:02:03.004_005_006).replace_nanosecond(7_008_009),
/// Ok(time!(01:02:03.007_008_009))
/// );
/// assert!(time!(01:02:03.004_005_006).replace_nanosecond(1_000_000_000).is_err()); // 1_000_000_000 isn't a valid nanosecond
/// assert!(time!(01:02:03.004_005_006)
/// .replace_nanosecond(1_000_000_000)
/// .is_err()); // 1_000_000_000 isn't a valid nanosecond
/// ```
#[must_use = "This method does not mutate the original `Time`."]
pub const fn replace_nanosecond(
Expand Down
1 change: 1 addition & 0 deletions time/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub const fn days_in_month(month: Month, year: i32) -> u8 {
/// Get the number of days in the month of a given year.
///
/// ```rust
/// # #![allow(deprecated)]
/// # use time::{Month, util};
/// assert_eq!(util::days_in_year_month(2020, Month::February), 29);
/// ```
Expand Down

0 comments on commit 0943997

Please sign in to comment.