Derive-crate cleanups from review#8
Merged
Merged
Conversation
- HumanByte derive now parses the input once and composes proc_macro2::TokenStreams directly instead of round-tripping every sub-derive through strings and re-parsing five times - unit constructors (kb, mib, ...) use checked_mul and panic on overflow instead of silently wrapping in release builds; documented and covered by a release-mode-verified regression test - fix range_stop doc (said lower bound, is upper bound) and the ByteSizeVistor -> ByteSizeVisitor typo
Stacked PRs (base = another feature branch) were getting no CI at all because of the pull_request branches filter.
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
kb(),mib(), …) now usechecked_muland panic with a clear message instead of silently wrapping in release builds.ByteScale::pb(20_000)used to return garbage; now it panics in both debug and release (regression test included, verified in--release). Inconstcontexts the panic becomes a compile error, which is strictly an improvement.#[derive(HumanByte)]parsed its input once per sub-derive and round-tripped everything through strings (format!on fiveTokenStreams, then re-parse). It now parses once and composesproc_macro2::TokenStreams directly. Generated code is identical; all tests pass unchanged.range_stopdoc said "explicit lower bound" (it sets the upper bound);ByteSizeVistor→ByteSizeVisitor.