From 875a552a447fb61b13a88b405ef60c9cde3b22d7 Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Wed, 3 May 2023 22:31:54 -0700 Subject: [PATCH 01/10] misc: test in debug and release modes --- .github/workflows/ci.yaml | 10 +++++++++- justfile | 14 ++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 8714b88..3f5e751 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -51,6 +51,7 @@ jobs: - name: Build run: | + cargo build --target ${{ matrix.target }} cargo build --release --target ${{ matrix.target }} - name: Clippy @@ -60,7 +61,14 @@ jobs: cargo clippy --release --features "serde" --target ${{ matrix.target }} cargo clippy --release --all-features --target ${{ matrix.target }} - - name: Tests + - name: Tests (Debug) + run: | + cargo test --target ${{ matrix.target }} + cargo test --features "local" --target ${{ matrix.target }} + cargo test --features "serde" --target ${{ matrix.target }} + cargo test --all-features --target ${{ matrix.target }} + + - name: Tests (Release) run: | cargo test --release --target ${{ matrix.target }} cargo test --release --features "local" --target ${{ matrix.target }} diff --git a/justfile b/justfile index f207ce3..a74d44d 100644 --- a/justfile +++ b/justfile @@ -44,16 +44,6 @@ bench BENCH="": exit 0 -# Check Release! -@check: - # First let's build the Rust bit. - cargo check \ - --release \ - --all-features \ - --target x86_64-unknown-linux-gnu \ - --target-dir "{{ cargo_dir }}" - - # Clean Cargo crap. @clean: # Most things go here. @@ -118,6 +108,10 @@ bench BENCH="": # Unit tests! @test: clear + cargo test \ + --all-features \ + --target x86_64-unknown-linux-gnu \ + --target-dir "{{ cargo_dir }}" cargo test \ --release \ --all-features \ From 3d9baa80a832e6f645b3762d844d427dae0239d6 Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Mon, 8 May 2023 18:45:46 -0700 Subject: [PATCH 02/10] unit: add debug assertions around `unsafe` --- src/date/mod.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/date/mod.rs b/src/date/mod.rs index d43c41e..040bea7 100644 --- a/src/date/mod.rs +++ b/src/date/mod.rs @@ -334,6 +334,12 @@ impl FmtUtc2k { // Safety: Abacus will have already normalized all ranges, so the // indices will be present in DD. + debug_assert!(usize::from(y << 1) + 1 < DD.len(), "Bug: Year out of range."); + debug_assert!(usize::from(m << 1) + 1 < DD.len(), "Bug: Month out of range."); + debug_assert!(usize::from(d << 1) + 1 < DD.len(), "Bug: Day out of range."); + debug_assert!(usize::from(hh << 1) + 1 < DD.len(), "Bug: Hours out of range."); + debug_assert!(usize::from(mm << 1) + 1 < DD.len(), "Bug: Minutes out of range."); + debug_assert!(usize::from(ss << 1) + 1 < DD.len(), "Bug: Seconds out of range."); unsafe { copy_nonoverlapping(src.add((y << 1) as usize), dst.add(2), 2); copy_nonoverlapping(src.add((m << 1) as usize), dst.add(5), 2); @@ -428,6 +434,7 @@ impl FmtUtc2k { /// ``` pub fn date(&self) -> &str { // Safety: datetimes are valid ASCII. + debug_assert!(self.0[..10].is_ascii(), "Bug: Date is not ASCII."); unsafe { std::str::from_utf8_unchecked(&self.0[..10]) } } @@ -449,6 +456,7 @@ impl FmtUtc2k { /// ``` pub fn year(&self) -> &str { // Safety: datetimes are valid ASCII. + debug_assert!(self.0.iter().take(4).all(u8::is_ascii_digit), "Bug: Year is not numeric."); unsafe { std::str::from_utf8_unchecked(&self.0[..4]) } } @@ -470,6 +478,7 @@ impl FmtUtc2k { /// ``` pub fn time(&self) -> &str { // Safety: datetimes are valid ASCII. + debug_assert!(self.0[11..].is_ascii(), "Bug: Time is not ASCII."); unsafe { std::str::from_utf8_unchecked(&self.0[11..]) } } } @@ -598,6 +607,7 @@ impl FmtUtc2k { ]; // Safety: datetimes are valid ASCII. + debug_assert!(out.is_ascii(), "Bug: Datetime is not ASCII."); unsafe { String::from_utf8_unchecked(out) } } } @@ -1688,6 +1698,7 @@ impl Utc2k { ]; // Safety: datetimes are valid ASCII. + debug_assert!(out.is_ascii(), "Bug: Datetime is not ASCII."); unsafe { String::from_utf8_unchecked(out) } } From 1290786c46f11237fd564342326eb2a960ec127b Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Mon, 8 May 2023 19:35:30 -0700 Subject: [PATCH 03/10] cleanup: remove some `unsafe`, redundant lists --- src/date/mod.rs | 6 +----- src/month.rs | 53 +++++++++++++++++++------------------------------ src/weekday.rs | 29 ++++++++++----------------- 3 files changed, 32 insertions(+), 56 deletions(-) diff --git a/src/date/mod.rs b/src/date/mod.rs index 040bea7..7f5faed 100644 --- a/src/date/mod.rs +++ b/src/date/mod.rs @@ -1360,7 +1360,6 @@ impl Utc2k { /// ``` pub const fn month(self) -> u8 { self.m } - #[allow(unsafe_code)] #[inline] #[must_use] /// # Month (enum). @@ -1375,10 +1374,7 @@ impl Utc2k { /// let date = Utc2k::new(2010, 5, 15, 16, 30, 1); /// assert_eq!(date.month_enum(), Month::May); /// ``` - pub const fn month_enum(self) -> Month { - // Safety: the month is validated during construction. - unsafe { Month::from_u8_unchecked(self.m) } - } + pub const fn month_enum(self) -> Month { Month::from_u8(self.m) } #[inline] #[must_use] diff --git a/src/month.rs b/src/month.rs index dc98e5d..3710212 100644 --- a/src/month.rs +++ b/src/month.rs @@ -30,7 +30,6 @@ use std::{ pub enum Month { #[default] January = 1_u8, - February, March, April, @@ -68,16 +67,7 @@ impl Deref for Month { macros::display_str!(as_str Month); impl From for Month { - #[allow(unsafe_code)] - fn from(src: u8) -> Self { - if src > 12 { Self::from(src % 12) } - else if src == 0 { Self::December } - else { - // Safety: values 1..=12 correspond directly to members of this - // enum. - unsafe { std::mem::transmute(src) } - } - } + fn from(src: u8) -> Self { Self::from_u8(src) } } impl From for u8 { @@ -102,21 +92,8 @@ macro_rules! impl_int { impl From<$ty> for Month { fn from(src: $ty) -> Self { - match src { - 1 => Self::January, - 2 => Self::February, - 3 => Self::March, - 4 => Self::April, - 5 => Self::May, - 6 => Self::June, - 7 => Self::July, - 8 => Self::August, - 9 => Self::September, - 10 => Self::October, - 11 => Self::November, - 0 | 12 => Self::December, - _ => Self::from(src % 12), - } + if src <= 12 { Self::from_u8(src as u8) } + else { Self::from_u8((src % 12) as u8) } } } @@ -397,16 +374,26 @@ impl Month { } } - #[allow(unsafe_code)] - #[doc(hidden)] #[inline] /// # From U8 Unchecked. /// - /// ## Safety - /// - /// The value must be between 1-12 or undefined things will happen! - pub(crate) const unsafe fn from_u8_unchecked(src: u8) -> Self { - std::mem::transmute(src) + /// This is the same as From, but const. + pub(crate) const fn from_u8(src: u8) -> Self { + match src { + 1 => Self::January, + 2 => Self::February, + 3 => Self::March, + 4 => Self::April, + 5 => Self::May, + 6 => Self::June, + 7 => Self::July, + 8 => Self::August, + 9 => Self::September, + 10 => Self::October, + 11 => Self::November, + 0 | 12 => Self::December, + _ => Self::from_u8(src % 12), + } } } diff --git a/src/weekday.rs b/src/weekday.rs index df35a84..8487729 100644 --- a/src/weekday.rs +++ b/src/weekday.rs @@ -34,7 +34,6 @@ use std::{ pub enum Weekday { #[default] Sunday = 1_u8, - Monday, Tuesday, Wednesday, @@ -67,14 +66,16 @@ impl Deref for Weekday { macros::display_str!(as_str Weekday); impl From for Weekday { - #[allow(unsafe_code)] fn from(src: u8) -> Self { - if src > 7 { Self::from(src % 7) } - else if src == 0 { Self::Saturday } - else { - // Safety: values 1..=7 correspond directly to members of this - // enum. - unsafe { std::mem::transmute(src) } + match src { + 1 => Self::Sunday, + 2 => Self::Monday, + 3 => Self::Tuesday, + 4 => Self::Wednesday, + 5 => Self::Thursday, + 6 => Self::Friday, + 0 | 7 => Self::Saturday, + _ => Self::from(src % 7), } } } @@ -101,16 +102,8 @@ macro_rules! impl_int { impl From<$ty> for Weekday { fn from(src: $ty) -> Self { - match src { - 1 => Self::Sunday, - 2 => Self::Monday, - 3 => Self::Tuesday, - 4 => Self::Wednesday, - 5 => Self::Thursday, - 6 => Self::Friday, - 0 | 7 => Self::Saturday, - _ => Self::from(src % 7), - } + if src <= 7 { Self::from(src as u8) } + else { Self::from((src % 7) as u8) } } } From e57544b8bf6eb345b66acc8cdb5eb284a6ba91fd Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Mon, 8 May 2023 19:41:10 -0700 Subject: [PATCH 04/10] unit: add one more debug assertion --- src/date/mod.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/date/mod.rs b/src/date/mod.rs index 7f5faed..80aab1a 100644 --- a/src/date/mod.rs +++ b/src/date/mod.rs @@ -348,6 +348,9 @@ impl FmtUtc2k { copy_nonoverlapping(src.add((mm << 1) as usize), dst.add(14), 2); copy_nonoverlapping(src.add((ss << 1) as usize), dst.add(17), 2); } + + // Additionally make sure the result is ASCII. + debug_assert!(self.0.is_ascii(), "Bug: Datetime is not ASCII."); } #[inline] From c488e0a005b46d9d0b1c9ce81239f94b01d35e2c Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Tue, 16 May 2023 19:40:48 -0700 Subject: [PATCH 05/10] cleanup: remove some more `unsafe` blocks perf: split up full range tests for (possible) parallelization --- justfile | 20 ++++++-- src/date/mod.rs | 118 ++++++++++++++++++++++++++---------------------- 2 files changed, 82 insertions(+), 56 deletions(-) diff --git a/justfile b/justfile index a74d44d..84a08d3 100644 --- a/justfile +++ b/justfile @@ -106,13 +106,27 @@ bench BENCH="": # Unit tests! -@test: +@test IGNORED="": clear - cargo test \ + fyi task "Debug Mode" + [ -z "{{ IGNORED }}" ] || cargo test \ + --all-features \ + --target x86_64-unknown-linux-gnu \ + --target-dir "{{ cargo_dir }}" \ + -- --include-ignored + [ ! -z "{{ IGNORED }}" ] || cargo test \ --all-features \ --target x86_64-unknown-linux-gnu \ --target-dir "{{ cargo_dir }}" - cargo test \ + + fyi task "Release Mode" + [ -z "{{ IGNORED }}" ] || cargo test \ + --release \ + --all-features \ + --target x86_64-unknown-linux-gnu \ + --target-dir "{{ cargo_dir }}" \ + -- --include-ignored + [ ! -z "{{ IGNORED }}" ] || cargo test \ --release \ --all-features \ --target x86_64-unknown-linux-gnu \ diff --git a/src/date/mod.rs b/src/date/mod.rs index 80aab1a..42e2e4e 100644 --- a/src/date/mod.rs +++ b/src/date/mod.rs @@ -34,12 +34,18 @@ use std::{ /// # Double-Digit ASCII. -const DD: &[u8; 200] = b"\ - 0001020304050607080910111213141516171819\ - 2021222324252627282930313233343536373839\ - 4041424344454647484950515253545556575859\ - 6061626364656667686970717273747576777879\ - 8081828384858687888990919293949596979899"; +static DD: [[u8; 2]; 100] = [ + [48, 48], [48, 49], [48, 50], [48, 51], [48, 52], [48, 53], [48, 54], [48, 55], [48, 56], [48, 57], + [49, 48], [49, 49], [49, 50], [49, 51], [49, 52], [49, 53], [49, 54], [49, 55], [49, 56], [49, 57], + [50, 48], [50, 49], [50, 50], [50, 51], [50, 52], [50, 53], [50, 54], [50, 55], [50, 56], [50, 57], + [51, 48], [51, 49], [51, 50], [51, 51], [51, 52], [51, 53], [51, 54], [51, 55], [51, 56], [51, 57], + [52, 48], [52, 49], [52, 50], [52, 51], [52, 52], [52, 53], [52, 54], [52, 55], [52, 56], [52, 57], + [53, 48], [53, 49], [53, 50], [53, 51], [53, 52], [53, 53], [53, 54], [53, 55], [53, 56], [53, 57], + [54, 48], [54, 49], [54, 50], [54, 51], [54, 52], [54, 53], [54, 54], [54, 55], [54, 56], [54, 57], + [55, 48], [55, 49], [55, 50], [55, 51], [55, 52], [55, 53], [55, 54], [55, 55], [55, 56], [55, 57], + [56, 48], [56, 49], [56, 50], [56, 51], [56, 52], [56, 53], [56, 54], [56, 55], [56, 56], [56, 57], + [57, 48], [57, 49], [57, 50], [57, 51], [57, 52], [57, 53], [57, 54], [57, 55], [57, 56], [57, 57] +]; @@ -319,7 +325,6 @@ impl FmtUtc2k { self.set_parts_unchecked(y, m, d, hh, mm, ss); } - #[allow(unsafe_code)] /// # Set Parts (Unchecked). /// /// Carry-overs, saturating, and 4-to-2-digit year-chopping have already @@ -327,26 +332,8 @@ impl FmtUtc2k { /// /// From here, it's just straight ASCII-writing. fn set_parts_unchecked(&mut self, y: u8, m: u8, d: u8, hh: u8, mm: u8, ss: u8) { - use std::ptr::copy_nonoverlapping; - - let src = DD.as_ptr(); - let dst = self.0.as_mut_ptr(); - - // Safety: Abacus will have already normalized all ranges, so the - // indices will be present in DD. - debug_assert!(usize::from(y << 1) + 1 < DD.len(), "Bug: Year out of range."); - debug_assert!(usize::from(m << 1) + 1 < DD.len(), "Bug: Month out of range."); - debug_assert!(usize::from(d << 1) + 1 < DD.len(), "Bug: Day out of range."); - debug_assert!(usize::from(hh << 1) + 1 < DD.len(), "Bug: Hours out of range."); - debug_assert!(usize::from(mm << 1) + 1 < DD.len(), "Bug: Minutes out of range."); - debug_assert!(usize::from(ss << 1) + 1 < DD.len(), "Bug: Seconds out of range."); - unsafe { - copy_nonoverlapping(src.add((y << 1) as usize), dst.add(2), 2); - copy_nonoverlapping(src.add((m << 1) as usize), dst.add(5), 2); - copy_nonoverlapping(src.add((d << 1) as usize), dst.add(8), 2); - copy_nonoverlapping(src.add((hh << 1) as usize), dst.add(11), 2); - copy_nonoverlapping(src.add((mm << 1) as usize), dst.add(14), 2); - copy_nonoverlapping(src.add((ss << 1) as usize), dst.add(17), 2); + for (chunk, v) in self.0[1..].chunks_exact_mut(3).zip([y, m, d, hh, mm, ss]) { + chunk[1..].copy_from_slice(DD[usize::from(v)].as_slice()); } // Additionally make sure the result is ASCII. @@ -1675,24 +1662,24 @@ impl Utc2k { let weekday: [u8; 3] = self.weekday().abbreviation_bytes(); let month: [u8; 3] = self.month_enum().abbreviation_bytes(); - let d_idx = (self.d << 1) as usize; - let y_idx = (self.y << 1) as usize; - let hh_idx = (self.hh << 1) as usize; - let mm_idx = (self.mm << 1) as usize; - let ss_idx = (self.ss << 1) as usize; + let day = DD[usize::from(self.d)]; + let year = DD[usize::from(self.y)]; + let hh = DD[usize::from(self.hh)]; + let mm = DD[usize::from(self.mm)]; + let ss = DD[usize::from(self.ss)]; // Working from bytes is ugly, but performs much better than any // string-based operations. let out: Vec = vec![ weekday[0], weekday[1], weekday[2], b',', b' ', - DD[d_idx], DD[d_idx + 1], + day[0], day[1], b' ', month[0], month[1], month[2], b' ', - b'2', b'0', DD[y_idx], DD[y_idx + 1], + b'2', b'0', year[0], year[1], b' ', - DD[hh_idx], DD[hh_idx + 1], b':', DD[mm_idx], DD[mm_idx + 1], b':', DD[ss_idx], DD[ss_idx + 1], + hh[0], hh[1], b':', mm[0], mm[1], b':', ss[0], ss[1], b' ', b'+', b'0', b'0', b'0', b'0' ]; @@ -2078,35 +2065,60 @@ mod tests { ); } + #[cfg(not(debug_assertions))] + macro_rules! century_test { + ($rem:literal) => ( + let mut buf = FmtUtc2k::default(); + let format = time::format_description::parse( + "[year]-[month]-[day] [hour]:[minute]:[second]", + ).expect("Unable to parse datetime format."); + for i in Utc2k::MIN_UNIXTIME..=Utc2k::MAX_UNIXTIME { + if $rem == i % 4 { range_test!(buf, i, format); } + } + ); + } + + #[cfg(not(debug_assertions))] #[test] - #[ignore] - /// # Full Range Unixtime Test. + #[ignore = "testing a quarter century's worth of seconds takes a very long time"] + /// # 1/4 Full Range Unixtime Test. /// - /// This compares our objects against `chrono` to ensure conversions line + /// This compares our objects against `time` to ensure conversions line /// up as expected for the supported unixtime range. /// - /// With billions of seconds to check, this takes a very long time to - /// complete. - fn full_unixtime() { - let mut buf = FmtUtc2k::default(); - let format = time::format_description::parse( - "[year]-[month]-[day] [hour]:[minute]:[second]", - ).expect("Unable to parse datetime format."); - for i in Utc2k::MIN_UNIXTIME..=Utc2k::MAX_UNIXTIME { - range_test!(buf, i, format); - } - } + /// There are a lot of seconds in a century, so this test is split into + /// four to allow for possible parallelized execution. + fn full_unixtime_0() { century_test!(0); } + + #[cfg(not(debug_assertions))] + #[test] + #[ignore = "testing a quarter century's worth of seconds takes a very long time"] + /// # 1/4 Full Range Unixtime Test. + fn full_unixtime_1() { century_test!(1); } + + #[cfg(not(debug_assertions))] + #[test] + #[ignore = "testing a quarter century's worth of seconds takes a very long time"] + /// # 1/4 Full Range Unixtime Test. + fn full_unixtime_2() { century_test!(2); } + + #[cfg(not(debug_assertions))] + #[test] + #[ignore = "testing a quarter century's worth of seconds takes a very long time"] + /// # 1/4 Full Range Unixtime Test. + fn full_unixtime_3() { century_test!(3); } #[test] /// # Limited Range Unixtime Test. /// - /// This performs the same tests as [`full_unixtime`], but applies them - /// against 5 million random entries from the range rather than the whole - /// thing. + /// This performs the same tests as `full_unixtime`, but only covers a + /// random subset of the possible values — five million of them — to keep + /// the runtime within the realm of reason. /// - /// This provides reasonable coverage in reasonable time. + /// (Testing every single second takes _forever_, so is disabled by + /// default.) fn limited_unixtime() { let mut buf = FmtUtc2k::default(); let format = time::format_description::parse( From f6d19944df0d069a0ef6f1119b67ed9a80ac989c Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Tue, 16 May 2023 22:50:14 -0700 Subject: [PATCH 06/10] drop: once_cell bump: msrv 1.70 --- Cargo.toml | 8 ++------ src/local.rs | 8 +++++--- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6109890..3c8ef7f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "utc2k" version = "0.5.15" authors = ["Blobfolio, LLC. "] edition = "2021" -rust-version = "1.62" +rust-version = "1.70" description = "A fast and lean UTC date/time library concerned only with happenings in this century (2000-2099)." license = "WTFPL" repository = "https://github.com/Blobfolio/utc2k" @@ -41,10 +41,6 @@ version = "0.3.*" default-features = false features = [ "std", "formatting" ] -[dependencies.once_cell] -version = ">= 1.13.1, < 1.18.0" -optional = true - [dependencies.serde] version = "1.0.*" optional = true @@ -60,7 +56,7 @@ default = [] # This enables the "LocalOffset" struct for tricking — with caveats — Utc2k # and FmtUtc2k into holding a local datetime rather than a UTC one. This only # works on unix, but won't break non-unix builds. -local = [ "once_cell", "tz-rs" ] +local = [ "tz-rs" ] # This enables (de)/serialize support for Utc2k and FmtUtc2k. serde = [ "dep:serde" ] diff --git a/src/local.rs b/src/local.rs index 0a75a6a..453146e 100644 --- a/src/local.rs +++ b/src/local.rs @@ -6,8 +6,10 @@ use crate::{ FmtUtc2k, Utc2k, }; -use once_cell::sync::OnceCell; -use std::ops::Neg; +use std::{ + ops::Neg, + sync::OnceLock, +}; use tz::timezone::{ LocalTimeType, TimeZone, @@ -194,7 +196,7 @@ impl From for Utc2k { /// # Parsed Timezone Details. -static TZ: OnceCell = OnceCell::new(); +static TZ: OnceLock = OnceLock::new(); /// # Offset From Unixtime. /// From e122091846428d5da4cf5b2694975b8a0e72aa76 Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Thu, 18 May 2023 20:07:14 -0700 Subject: [PATCH 07/10] ci: test MSRV --- .github/workflows/ci.yaml | 4 +-- .github/workflows/msrv.yaml | 56 +++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/msrv.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 3f5e751..f9d3f3d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,9 +2,9 @@ name: Build on: push: - branches: [ master ] + branches: [] pull_request: - branches: [ master ] + branches: [] defaults: run: diff --git a/.github/workflows/msrv.yaml b/.github/workflows/msrv.yaml new file mode 100644 index 0000000..6b7f066 --- /dev/null +++ b/.github/workflows/msrv.yaml @@ -0,0 +1,56 @@ +name: MSRV + +on: + push: + branches: [] + pull_request: + branches: [] + +defaults: + run: + shell: bash + +env: + CARGO_TERM_COLOR: always + +jobs: + all: + name: All + + strategy: + matrix: + target: + - x86_64-unknown-linux-gnu + - x86_64-apple-darwin + - x86_64-pc-windows-msvc + include: + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + - target: x86_64-apple-darwin + os: macos-latest + - target: x86_64-pc-windows-msvc + os: windows-latest + + runs-on: ${{matrix.os}} + + env: + RUSTFLAGS: "-D warnings" + + steps: + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + - uses: taiki-e/install-action@v2 + with: + tool: cargo-msrv + + - name: Info + run: | + rustup --version + cargo --version + cargo clippy --version + + - name: MSRV + run: | + cargo msrv verify -- cargo check --all-features From 3838eb10d3c47ad0b559cf00b84361f81cbeb1f2 Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Thu, 1 Jun 2023 12:55:34 -0700 Subject: [PATCH 08/10] bump: brunch 0.5 (dev) --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 3c8ef7f..6c4dffc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ man-dir = "./" credits-dir = "./" [dev-dependencies] -brunch = "0.4.*" +brunch = "0.5.*" fastrand = "1.9.*" serde = "1.0.*" serde_json = "1.0.*" From 840fd6743b07e6854eb01dbe21861d18714b37d9 Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Thu, 1 Jun 2023 12:55:55 -0700 Subject: [PATCH 09/10] ci: remove windows target from msrv --- .github/workflows/msrv.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/msrv.yaml b/.github/workflows/msrv.yaml index 6b7f066..1172ee8 100644 --- a/.github/workflows/msrv.yaml +++ b/.github/workflows/msrv.yaml @@ -22,14 +22,11 @@ jobs: target: - x86_64-unknown-linux-gnu - x86_64-apple-darwin - - x86_64-pc-windows-msvc include: - target: x86_64-unknown-linux-gnu os: ubuntu-latest - target: x86_64-apple-darwin os: macos-latest - - target: x86_64-pc-windows-msvc - os: windows-latest runs-on: ${{matrix.os}} From be7df434553af12d695c9594cbe16facf7c7f9de Mon Sep 17 00:00:00 2001 From: Josh Stoik Date: Thu, 1 Jun 2023 13:00:16 -0700 Subject: [PATCH 10/10] bump: 0.6.0 --- CHANGELOG.md | 13 +++++++++++++ CREDITS.md | 2 +- Cargo.toml | 2 +- README.md | 2 +- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 734bc28..d2e2252 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,19 @@ +## [0.6.0](https://github.com/Blobfolio/utc2k/releases/tag/v0.6.0) - 2023-06-01 + +### Changed + +* Bump MSRV `1.70` +* Drop `once_cell` (in favor of new built-in types) +* Replace various `unsafe` blocks with safe alternatives +* Add debug/assertions for logical redundancy +* CI: test in debug and release modes +* CI: test MSRV + + + ## [0.5.15](https://github.com/Blobfolio/utc2k/releases/tag/v0.5.15) - 2023-02-15 ### Changed diff --git a/CREDITS.md b/CREDITS.md index ebcabe8..6d00aa5 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -1,6 +1,6 @@ # Project Dependencies Package: utc2k Version: 0.5.15 - Generated: 2023-02-15 16:38:48 UTC + Generated: 2023-06-01 19:58:37 UTC This package has no dependencies. diff --git a/Cargo.toml b/Cargo.toml index 6c4dffc..6743351 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "utc2k" -version = "0.5.15" +version = "0.6.0" authors = ["Blobfolio, LLC. "] edition = "2021" rust-version = "1.70" diff --git a/README.md b/README.md index 8ca0634..be4f0e1 100644 --- a/README.md +++ b/README.md @@ -94,7 +94,7 @@ Add `utc2k` to your `dependencies` in `Cargo.toml`, like: ``` [dependencies] -utc2k = "0.5.*" +utc2k = "0.6.*" ```