Skip to content

refactor: remove dead PRQL_VERSION_OVERRIDE re-check in compiler_version#6067

Open
prql-bot wants to merge 1 commit into
mainfrom
refactor/compiler-version-dedup
Open

refactor: remove dead PRQL_VERSION_OVERRIDE re-check in compiler_version#6067
prql-bot wants to merge 1 commit into
mainfrom
refactor/compiler-version-dedup

Conversation

@prql-bot

@prql-bot prql-bot commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Nightly code-quality sweep finding.

compiler_version() checks PRQL_VERSION_OVERRIDE twice: once at the top of the function (which returns early when the env var is set), and again inside the OnceLock::get_or_init closure. The closure only runs when the early return at the top did not fire — i.e. when the env var is unset — so the inner if let Ok(prql_version_override) = std::env::var("PRQL_VERSION_OVERRIDE") branch is unreachable dead code.

This removes the redundant inner check. Behavior is unchanged: the outer check already guarantees the env var is honored on every call (as the doc comment describes), and the OnceLock continues to cache the git/cargo-derived version.

No regression test is included because this is a pure dead-code removal with no observable behavior change — the outer check remains and there is no code path that reaches the removed branch.

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