Skip to content

Lrpar build cleanups - #654

Open
ratmice wants to merge 2 commits into
softdevteam:masterfrom
ratmice:lrpar_build_cleanups
Open

Lrpar build cleanups#654
ratmice wants to merge 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.

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