diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 27db52f29..d58706956 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -52,7 +52,7 @@ jobs: strategy: matrix: rust: - - { version: "1.61.0", name: MSRV } + - { version: "1.62.0", name: MSRV } - { version: stable, name: stable } kind: - name: no_std @@ -153,7 +153,7 @@ jobs: strategy: matrix: rust: - - { version: "1.61.0", name: MSRV } + - { version: "1.62.0", name: MSRV } - { version: stable, name: stable } os: - { name: Ubuntu, value: ubuntu-20.04 } diff --git a/.github/workflows/powerset.yaml b/.github/workflows/powerset.yaml index 32d7736a8..8b0bd21eb 100644 --- a/.github/workflows/powerset.yaml +++ b/.github/workflows/powerset.yaml @@ -53,7 +53,7 @@ jobs: strategy: matrix: rust: - - { version: "1.61.0", name: MSRV } + - { version: "1.62.0", name: MSRV } - { version: stable, name: stable } kind: - name: no_std diff --git a/README.md b/README.md index e8a30b7e0..59b0776f2 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # time -[![minimum rustc: 1.61](https://img.shields.io/badge/minimum%20rustc-1.61-yellowgreen?logo=rust&style=flat-square)](https://www.whatrustisit.com) +[![minimum rustc: 1.62](https://img.shields.io/badge/minimum%20rustc-1.62-yellowgreen?logo=rust&style=flat-square)](https://www.whatrustisit.com) [![version](https://img.shields.io/crates/v/time?color=blue&logo=rust&style=flat-square)](https://crates.io/crates/time) [![build status](https://img.shields.io/github/actions/workflow/status/time-rs/time/build.yaml?branch=main&style=flat-square)](https://github.com/time-rs/time/actions) [![codecov](https://codecov.io/gh/time-rs/time/branch/main/graph/badge.svg?token=yt4XSmQNKQ)](https://codecov.io/gh/time-rs/time) diff --git a/time-core/Cargo.toml b/time-core/Cargo.toml index f5a63cbd8..2d1d15fbc 100644 --- a/time-core/Cargo.toml +++ b/time-core/Cargo.toml @@ -3,7 +3,7 @@ name = "time-core" version = "0.1.0" authors = ["Jacob Pratt ", "Time contributors"] edition = "2021" -rust-version = "1.60.0" +rust-version = "1.62.0" repository = "https://github.com/time-rs/time" keywords = ["date", "time", "calendar", "duration"] categories = ["date-and-time"] diff --git a/time-macros/Cargo.toml b/time-macros/Cargo.toml index da68ff6ad..377bb3bd8 100644 --- a/time-macros/Cargo.toml +++ b/time-macros/Cargo.toml @@ -3,7 +3,7 @@ name = "time-macros" version = "0.2.6" authors = ["Jacob Pratt ", "Time contributors"] edition = "2021" -rust-version = "1.61.0" +rust-version = "1.62.0" repository = "https://github.com/time-rs/time" keywords = ["date", "time", "calendar", "duration"] categories = ["date-and-time"] diff --git a/time-macros/src/format_description/format_item.rs b/time-macros/src/format_description/format_item.rs index 61af5d5fe..a0b924990 100644 --- a/time-macros/src/format_description/format_item.rs +++ b/time-macros/src/format_description/format_item.rs @@ -249,17 +249,6 @@ macro_rules! target_value { }; } -macro_rules! derived_default_on_enum { - ($type:ty; $default:expr) => {}; - ($attr:meta $type:ty; $default:expr) => { - impl Default for $type { - fn default() -> Self { - $default - } - } - }; -} - macro_rules! modifier { ($( enum $name:ident $(($target_ty:ty))? { @@ -269,14 +258,11 @@ macro_rules! modifier { ),* $(,)? } )+) => {$( + #[derive(Default)] enum $name { - $($variant),* + $($(#[$attr])? $variant),* } - $(derived_default_on_enum! { - $($attr)? $name; $name::$variant - })* - impl $name { /// Parse the modifier from its string representation. fn from_modifier_value(value: &Spanned<&[u8]>) -> Result, Error> { diff --git a/time/Cargo.toml b/time/Cargo.toml index dfcee474e..a02b78604 100644 --- a/time/Cargo.toml +++ b/time/Cargo.toml @@ -3,7 +3,7 @@ name = "time" version = "0.3.17" authors = ["Jacob Pratt ", "Time contributors"] edition = "2021" -rust-version = "1.60.0" +rust-version = "1.62.0" repository = "https://github.com/time-rs/time" homepage = "https://time-rs.github.io" keywords = ["date", "time", "calendar", "duration"] diff --git a/time/src/format_description/parse/format_item.rs b/time/src/format_description/parse/format_item.rs index ffa550b49..fbc990c69 100644 --- a/time/src/format_description/parse/format_item.rs +++ b/time/src/format_description/parse/format_item.rs @@ -311,19 +311,6 @@ macro_rules! target_value { }; } -// TODO use `#[derive(Default)]` on enums once MSRV is 1.62 (NET 2022-12-30) -/// Simulate `#[derive(Default)]` on enums. -macro_rules! derived_default_on_enum { - ($type:ty; $default:expr) => {}; - ($attr:meta $type:ty; $default:expr) => { - impl Default for $type { - fn default() -> Self { - $default - } - } - }; -} - /// Declare the various modifiers. /// /// For the general case, ordinary syntax can be used. Note that you _must_ declare a default @@ -350,14 +337,11 @@ macro_rules! modifier { ),* $(,)? } )+) => {$( + #[derive(Default)] enum $name { - $($variant),* + $($(#[$attr])? $variant),* } - $(derived_default_on_enum! { - $($attr)? $name; $name::$variant - })* - impl $name { /// Parse the modifier from its string representation. fn from_modifier_value(value: &Spanned<&[u8]>) -> Result, Error> {