Skip to content

Conversation

@yunusemremeral
Copy link

refactor(codegen): extract arg_to_bool and arg_to_u32 as private helpers, 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.

Emre 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant