Skip to content

refine: avoid full Func clone and fix comment typo in resolver#6068

Open
prql-bot wants to merge 1 commit into
mainfrom
refine/resolver-functions-cleanup
Open

refine: avoid full Func clone and fix comment typo in resolver#6068
prql-bot wants to merge 1 commit into
mainfrom
refine/resolver-functions-cleanup

Conversation

@prql-bot

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

Copy link
Copy Markdown
Collaborator

Two small cleanups in semantic/resolver/functions.rs, found in the nightly code-quality sweep.

  • expr_of_func: func.clone().body.ty deep-cloned the entire Func (params, args, body, env, name hints) only to read body.ty, then discarded the clone. Replaced with func.body.ty.clone(), which clones just the Option<Ty>. Behavior is identical — func itself is still moved into ExprKind::Func(func) a few lines later, so nothing else changes.
  • Doc comment typo: "Will return Err(func) is partial application is required" → "if partial application is required".

No regression test is included: the clone change is a pure allocation optimization that yields the same value, and the other change is a comment fix. Both are covered by the existing resolver test suite (cargo test -p prqlc --lib resolver, all passing).

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