refactor: remove dead PRQL_VERSION_OVERRIDE re-check in compiler_version#6067
Open
prql-bot wants to merge 1 commit into
Open
refactor: remove dead PRQL_VERSION_OVERRIDE re-check in compiler_version#6067prql-bot wants to merge 1 commit into
prql-bot wants to merge 1 commit into
Conversation
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.
Nightly code-quality sweep finding.
compiler_version()checksPRQL_VERSION_OVERRIDEtwice: once at the top of the function (which returns early when the env var is set), and again inside theOnceLock::get_or_initclosure. The closure only runs when the early return at the top did not fire — i.e. when the env var is unset — so the innerif 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
OnceLockcontinues 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.