Skip to content

Conversation

@Rachelint
Copy link
Contributor

Which issue does this PR close?

  • Closes #.

Rationale for this change

I found some unnecessary struct creation in SessionStateBuilder::build due to using unwrap_or, and switch to unwrap_or_else can eliminate them.

What changes are included in this PR?

Use unwrap_or_else to slightly improve SessionStateBuilder::build.

Are these changes tested?

Not need

Are there any user-facing changes?

No.

@github-actions github-actions bot added the core Core DataFusion crate label Apr 22, 2025
@Rachelint Rachelint changed the title Minor: eliminate unnecessary struct creation in session state build. Minor: eliminate unnecessary struct creation in session state build Apr 22, 2025
Copy link
Member

@waynexia waynexia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

I'm wondering if there is a clippy rule for this case

@Rachelint
Copy link
Contributor Author

👍

I'm wondering if there is a clippy rule for this case

I think it a good idea, I am trying to do it like what have been done about Arc::clone

@xudong963
Copy link
Member

Thank you

@xudong963 xudong963 merged commit fd8a0f8 into apache:main Apr 22, 2025
28 checks passed
nirnayroy pushed a commit to nirnayroy/datafusion that referenced this pull request May 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core Core DataFusion crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants