This repository was archived by the owner on Sep 24, 2026. It is now read-only.
Make crate no_std and improve CI/metadata - #14
Merged
Merged
Conversation
- Convert the crate to #![no_std] (uses only core); add #![forbid(unsafe_code)] and #![warn(missing_docs)] - Add Cargo.toml metadata for crates.io: keywords, categories, rust-version (MSRV 1.56), readme - Add CHANGELOG.md documenting the 0.1 -> 0.3 history - Fix README title (range_cmp -> range-cmp) and note no_std support - Harden CI: stable/beta/MSRV test matrix, no_std bare-metal build check, and a cargo publish --dry-run packaging gate
All jobs failed at setup because the org restricts GitHub Actions to GitHub-owned actions, and dtolnay/rust-toolchain is not allowed. Use the preinstalled rustup to install the matrix toolchains, components, and the bare-metal target instead, keeping only actions/checkout and actions/cache.
Jobs were failing at startup (no runner, no logs, ~3s) because the org's allowed-actions policy permits the v3 pins used historically but not v4. Revert to v3, keeping the rustup-driven toolchain matrix.
MSRV:
- Switch to edition 2018 and avoid later-stabilized conveniences: nested
or-patterns (1.53), the matches! macro (1.42), and the f64::NAN associated
constant in doctests (1.43). The floor is now 1.35, gated only by the
RangeBounds API. No public API changes; all tests pass on 1.35.0.
CI:
- This environment's Actions runner only dispatches the original single-job
workflow, so fold every check (fmt, clippy, build, test, doc, MSRV 1.35
build, no_std bare-metal build, publish dry-run) into the single
lint-and-test job as sequential steps, pinned to actions/{checkout,cache}@V3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR makes the
range-cmpcrate#![no_std]compatible while improving project metadata, documentation, and CI/CD workflows.Key Changes
Core Library Changes
#![no_std]attribute (withstdenabled only for tests) to make the crate usable in embedded and no_std environmentsstd::imports withcore::equivalents (borrow,cmp,ops)#![forbid(unsafe_code)]and#![warn(missing_docs)]for better code qualitycore::opsinstead ofstd::opsand added a new "no_std" section to the crate documentationProject Metadata (Cargo.toml)
rust-version = "1.56"to specify MSRV (Minimum Supported Rust Version)readme = "README.md"to link the README on crates.iokeywordsandcategoriesfor better discoverability on crates.ioCI/CD Improvements
lint-and-testjob into separate focused jobs:lint: Format checking, clippy linting, and documentation generationtest: Build and test across multiple toolchains (stable, beta, 1.56)no_std: Verify bare-metal compilation (thumbv7em-none-eabi target)package: Dry-run publish checkdtolnay/rust-toolchainfor more reliable toolchain setupactions/checkoutandactions/cacheto v4--allto--all-targets --allfor more comprehensive lintingDocumentation
Notable Implementation Details
https://claude.ai/code/session_01R3nRySjBNxWQZebDKJ4wme