refactor(codegen): extract arg_to_bool/u32 helpers and enhance parser clarity#1
Open
yunusemremeral wants to merge 2 commits intosuccinctlabs:mainfrom
Open
refactor(codegen): extract arg_to_bool/u32 helpers and enhance parser clarity#1yunusemremeral wants to merge 2 commits intosuccinctlabs:mainfrom
yunusemremeral wants to merge 2 commits intosuccinctlabs:mainfrom
Conversation
added 2 commits
July 11, 2025 15:17
…ers, improve flag parsing - Moved `arg_to_bool` and `arg_to_u32` into `RustcCodegenFlags` as private methods to reduce duplication and improve readability. - Updated all usages to call these methods via `Self::` for consistency. - Improved error message in test helper `check()` to show input on assertion failure. - Added explanatory comment to `CARGO_ENCODED_RUSTFLAGS` split logic. - Minor cleanup in `set_rustc_flag` for consistent handling of boolean and numeric flags. These changes improve maintainability and debuggability of rustc flag parsing logic.
…larity and maintainability. Enhanced panic messages in must_have, must_not_have, and must_have_in_order to provide more informative error details. Removed unnecessary OsStr::new conversions and used direct string comparisons for efficiency. Updated must_have_in_order to use the first occurrence of arguments for more predictable behavior. These changes improve test diagnostics and code readability in the test support module.
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.
refactor(codegen): extract arg_to_bool and arg_to_u32 as private helpers, improve flag parsing
arg_to_boolandarg_to_u32intoRustcCodegenFlagsas private methods to reduce duplication and improve readability.Self::for consistency.check()to show input on assertion failure.CARGO_ENCODED_RUSTFLAGSsplit logic.set_rustc_flagfor consistent handling of boolean and numeric flags.These changes improve maintainability and debuggability of rustc flag parsing logic.