Skip to content

Commit

Permalink
Merge branch 'main' into stub-tz-transition-method
Browse files Browse the repository at this point in the history
  • Loading branch information
nekevss authored Feb 24, 2025
2 parents b77c163 + e820d04 commit 10d5599
Show file tree
Hide file tree
Showing 24 changed files with 463 additions and 238 deletions.
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ updates:
applies-to: version-updates
patterns: ["*"]
update-types:
- "minor"
- "patch"
- "minor"
- "patch"
- package-ecosystem: cargo
directory: /
schedule:
Expand All @@ -26,5 +26,5 @@ updates:
applies-to: version-updates
patterns: ["*"]
update-types:
- "minor"
- "patch"
- "minor"
- "patch"
2 changes: 1 addition & 1 deletion .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ changelog:
- C-testing
- title: Other Changes
labels:
- '*'
- "*"
61 changes: 37 additions & 24 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ name: Rust - Continuous integration

on:
push:
branches: [ "main" ]
branches: ["main"]
pull_request:
branches: [ "main" ]
branches: ["main"]

concurrency:
# Allow one run at a time for PRs, but multiple for other invocations
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true


env:
RUSTFLAGS: -Dwarnings
CARGO_TERM_COLOR: always
Expand All @@ -21,21 +20,21 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
with:
key: lint
- name: Install cargo-workspaces
run: cargo install cargo-workspaces
- name: Check rustfmt
run: cargo fmt --all -- --check
- name: Check clippy
run: cargo ws exec cargo clippy --all-features --all-targets
- name: Check clippy (No features)
run: cargo ws exec cargo clippy --no-default-features --all-targets
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- uses: Swatinem/rust-cache@v2
with:
key: lint
- name: Install cargo-workspaces
run: cargo install cargo-workspaces
- name: Check rustfmt
run: cargo fmt --all -- --check
- name: Check clippy
run: cargo ws exec cargo clippy --all-features --all-targets
- name: Check clippy (No features)
run: cargo ws exec cargo clippy --no-default-features --all-targets

msrv:
name: MSRV
Expand Down Expand Up @@ -76,15 +75,30 @@ jobs:
with:
key: build-test

- name: Cargo build
run: cargo build --quiet
- name: Test
run: cargo test

- name: Cargo build --all-features
run: cargo build --quiet --all-features
- name: Test --all-features
run: cargo test --all-features

feature-test:
name: Test feature matrix
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable
- uses: Swatinem/rust-cache@v2
with:
key: features-test
- name: Install cargo-all-features
uses: baptiste0928/[email protected]
with:
crate: cargo-all-features

- name: Test all features
run: cargo test-all-features

ffi:
name: Test FFI (${{ matrix.rust.name }}, ${{ matrix.os }})
strategy:
Expand Down Expand Up @@ -122,4 +136,3 @@ jobs:
key: docs
- name: Generate documentation
run: cargo doc -v --document-private-items --all-features

4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ bitflags = "2.7.0"
num-traits = "0.2.19"
ixdtf = { git = "https://github.com/unicode-org/icu4x.git", rev = "3d187da4d3f05b7e37603c4be3f2c1ce45100e03" }
iana-time-zone = "0.1.61"
log = "0.4.25"
log = "0.4.26"
tzif = "0.3.0"
jiff-tzdb = "0.1.2"
combine = "4.6.7"
Expand Down Expand Up @@ -73,3 +73,7 @@ compiled_data = ["tzdb"]
sys = ["std", "dep:web-time"]
tzdb = ["dep:tzif", "std", "dep:jiff-tzdb", "dep:combine"]
std = []

[package.metadata.cargo-all-features]
denylist = ["default"]
max_combination_size = 4
3 changes: 2 additions & 1 deletion src/builtins/compiled/now.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
#![cfg(feature = "sys")]

use crate::builtins::{
core::{Now, PlainDate, PlainDateTime, PlainTime},
TZ_PROVIDER,
};
use crate::sys;
use crate::{time::EpochNanoseconds, TemporalError, TemporalResult, TimeZone};

#[cfg(feature = "sys")]
impl Now {
/// Returns the current system time as a [`PlainDateTime`] with an optional
/// [`TimeZone`].
Expand Down
4 changes: 2 additions & 2 deletions src/builtins/compiled/zoneddatetime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
ArithmeticOverflow, DifferenceSettings, Disambiguation, DisplayCalendar, DisplayOffset,
DisplayTimeZone, OffsetDisambiguation, ToStringRoundingOptions,
},
Duration, PlainDate, PlainDateTime, PlainTime, TemporalError, TemporalResult,
Duration, MonthCode, PlainDate, PlainDateTime, PlainTime, TemporalError, TemporalResult,
};
use alloc::string::String;
use tinystr::TinyAsciiStr;
Expand Down Expand Up @@ -59,7 +59,7 @@ impl ZonedDateTime {
/// Returns the `ZonedDateTime`'s calendar month code.
///
/// Enable with the `compiled_data` feature flag.
pub fn month_code(&self) -> TemporalResult<TinyAsciiStr<4>> {
pub fn month_code(&self) -> TemporalResult<MonthCode> {
let provider = TZ_PROVIDER
.lock()
.map_err(|_| TemporalError::general("Unable to acquire lock"))?;
Expand Down
Loading

0 comments on commit 10d5599

Please sign in to comment.