From 09439970e55f191d992a1d5bc50e2d7dab19b33d Mon Sep 17 00:00:00 2001 From: Jacob Pratt Date: Mon, 2 Dec 2024 23:22:10 -0500 Subject: [PATCH] Fix CI failure --- tests/main.rs | 4 ---- tests/util.rs | 5 ++++- time/src/macros.rs | 2 +- time/src/time.rs | 12 +++++++++--- time/src/util.rs | 1 + 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/main.rs b/tests/main.rs index 522c55a01..6e20098bc 100644 --- a/tests/main.rs +++ b/tests/main.rs @@ -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 $({ diff --git a/tests/util.rs b/tests/util.rs index 3534b1f66..f0c05169b 100644 --- a/tests/util.rs +++ b/tests/util.rs @@ -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] diff --git a/time/src/macros.rs b/time/src/macros.rs index 4167f3246..b50438f7e 100644 --- a/time/src/macros.rs +++ b/time/src/macros.rs @@ -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). /// diff --git a/time/src/time.rs b/time/src/time.rs index 24ba2011a..57643cf89 100644 --- a/time/src/time.rs +++ b/time/src/time.rs @@ -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( @@ -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( @@ -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( diff --git a/time/src/util.rs b/time/src/util.rs index 6a0e9e430..9093f3363 100644 --- a/time/src/util.rs +++ b/time/src/util.rs @@ -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); /// ```