Skip to content

refactor: Replace std::num and std::cmp with core::num and core::cmp - #1276

Merged
Pr0methean merged 8 commits into
masterfrom
small-changes-roll-up-2026-11-05
Nov 7, 2026
Merged

Pr0methean merged 8 commits into
masterfrom
small-changes-roll-up-2026-11-05

Conversation

@Pr0methean

@Pr0methean Pr0methean commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

And doc/CI fixes.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR replaces std::num and std::cmp with their core:: equivalents across several files, alongside a CI runner change and a workflow trigger fix. All changes are reviewed and no blocking defects were found.

Summary of changes:

  • benches/deflate_alloc.rs, src/write.rs, tests/write_parallel.rs: std::num::NonZeroUsize → core::num::NonZeroUsize
  • src/datetime.rs, tests/eocd_complexity_distinct_offsets.rs: std::cmp::Ordering → core::cmp::Ordering
  • src/read/readers.rs: std::cmp::min → core::cmp::min
  • src/write.rs: std::marker::PhantomData → core::marker::PhantomData
  • .github/workflows/ci.yml: Runner changed from ubuntu-latest to ubuntu-slim
  • .github/workflows/size_labels.yml: Trigger changed from pull_request_target to pull_request

All Rust std::* → core::* substitutions are functionally identical since std re-exports core items. The workflow trigger change from pull_request_target to pull_request is actually a security improvement: pull_request_target grants the workflow repository-level write permissions even when triggered from a fork, which is unnecessary for a labeling action. The PR is clean and ready to merge pending CI confirmation.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

@ByGh00st

ByGh00st commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Hey @Pr0methean, heads up on the cargo_fmt failure on master:

It wasn't caused by #1275 — it's from the unformatted lines in src/path.rs:57 introduced in commit 92a940a (the advisory PR):

-    let Some(stem) = name
-        .split(['.', ':'])
-        .next() else {
+    let Some(stem) = name.split(['.', ':']).next() else {

Reverting #1275 doesn't fix cargo_fmt (which is why this PR is still failing with the exact same diff on src/path.rs:57), and reverting #1275 will also re-introduce the Miri / Linux CI test failures on invalid_path.rs that #1275 resolved.

If you drop the revert commit and just run cargo fmt on src/path.rs:57, all checks will turn green!

@Pr0methean
Pr0methean force-pushed the small-changes-roll-up-2026-11-05 branch from 0fd7b16 to adc9ac9 Compare November 7, 2026 19:44
@Pr0methean
Pr0methean added this pull request to the merge queue Nov 7, 2026
Merged via the queue into master with commit a051b5a Nov 7, 2026
130 checks passed
@Pr0methean
Pr0methean deleted the small-changes-roll-up-2026-11-05 branch November 7, 2026 20:50
@Pr0methean Pr0methean mentioned this pull request Nov 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants