Skip to content

Lrpar build cleanups - #654

Merged
ltratt merged 2 commits into
softdevteam:masterfrom
ratmice:lrpar_build_cleanups
Aug 4, 2026
Merged

Lrpar build cleanups#654
ltratt merged 2 commits into
softdevteam:masterfrom
ratmice:lrpar_build_cleanups

Conversation

@ratmice

@ratmice ratmice commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

This is mostly just reformatting/reordering code,

In 63f32e7 I had reformatted this code to use a match statement, which increased the indent
to avoid a clippy lint.

I found that by using return Err(ErrorString(out).into) instead of return Err(ErrorString(out))?; we can avoid the clippy lint without increasing indentation levels.

The second patch pulls some if guards out of a match statement, turning

match result {
  Ok(...) if warnings_are_errors && !warnings.is_empty() => {
   }
   Ok(...) => {
       if !warnings.is_empty() > {
       }
  }
  Err(errs) => ...,
}

Into a simpler sequence of statements:

if warnings_are_errors && !warnings.is_empty() {
   ...
} else !warnings.is_empty() {
   ...
}

match result {
   Ok(...) => ...,
   Err(errs) => ...,
}

These are kind of helpful for trying to split out the codegen, since in the patches for separating codegen out,
the match statements have been moved into part of codegen the bring-up, while the if statements/warning handling stay in CTParserBuilder since they deal with cargo.

@ltratt

ltratt commented Aug 4, 2026

Copy link
Copy Markdown
Member

Agreed!

@ltratt
ltratt added this pull request to the merge queue Aug 4, 2026
Merged via the queue into softdevteam:master with commit d1d64ed Aug 4, 2026
2 checks passed
@ratmice
ratmice deleted the lrpar_build_cleanups branch August 4, 2026 21:53
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.

2 participants