chore: bump MSRV to 1.93 and adopt new stdlib helpers#474
Conversation
Aligns the workspace MSRV with the oldest Rust toolchain supported in Microsoft. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use core::fmt::from_fn (stable in 1.93) to replace single-use Display/Debug adapter structs in data_privacy and its tests. Use VecDeque::pop_front_if (stable in 1.93) for sliding-window expiry in the seatbelt circuit-breaker health metrics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR raises the workspace minimum supported Rust version (MSRV) from 1.91 to 1.93 and then simplifies several formatting adapters / window-expiry loops by adopting stdlib helpers available in Rust 1.93 (core::fmt::from_fn, VecDeque::pop_front_if).
Changes:
- Bump workspace MSRV to Rust 1.93 in
Cargo.tomlandconstants.env. - Replace local
Display/Debugadapter structs withcore::fmt::from_fnwrappers indata_privacyanddata_privacy_core. - Simplify
VecDequesliding-window expiry logic usingVecDeque::pop_front_ifinseatbelt.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Updates [workspace.package].rust-version to 1.93 (workspace MSRV bump). |
| constants.env | Updates RUST_MSRV to 1.93 to match the workspace MSRV promise. |
| crates/data_privacy/src/redaction_engine.rs | Uses core::fmt::from_fn instead of local ZST formatter wrappers for redacted debug/display output. |
| crates/data_privacy_core/src/redacted.rs | Uses core::fmt::from_fn in the RedactedToString blanket impl instead of an inline adapter struct. |
| crates/data_privacy/src/sensitive.rs | Refactors tests to use core::fmt::from_fn instead of inline adapter structs for redacted formatting snapshots. |
| crates/seatbelt/src/breaker/health.rs | Uses VecDeque::pop_front_if for window expiry instead of manual front() + pop_front() looping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #474 +/- ##
=======================================
Coverage 100.0% 100.0%
=======================================
Files 313 313
Lines 24121 24112 -9
=======================================
- Hits 24121 24112 -9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
|
Bumps the workspace MSRV from 1.91 to 1.93 to align with the oldest Rust toolchain supported across Microsoft, and adopts a couple of stdlib helpers that became stable in 1.93.
Commit 1 —
chore: bump MSRV to 1.93Cargo.toml:rust-version = "1.93"constants.env:RUST_MSRV=1.93The workspace was already MSRV-clean on 1.93 — no code changes or new lint suppressions were needed for the bump itself.
Commit 2 —
refactor: adopt MSRV 1.93 stdlib improvementsNet: +15 / −96 across 4 files.
data_privacy/src/redaction_engine.rsDebugFormatter/DisplayFormatterZST wrapper structs withcore::fmt::from_fnclosures inredacted_debug/redacted_display.data_privacy_core/src/redacted.rsAdapterstruct in theRedactedToStringblanket impl withcore::fmt::from_fn.data_privacy/src/sensitive.rsAdapterstructs in tests withcore::fmt::from_fn.seatbelt/src/breaker/health.rswhile let Some(front) = … front()/pop_front()sliding-window expiry withVecDeque::pop_front_if.core::fmt::from_fn(stable in 1.93) returns a wrapper that implements bothDisplayandDebugfrom the same closure, so it cleanly subsumes both adapter patterns.