Skip to content

Conversation

@overlookmotel
Copy link
Member

@overlookmotel overlookmotel commented Mar 24, 2025

Small refactor. Fieldless enums are Copy, so it's pointless passing references to them (&self) into methods. Pass self instead.

Additionally, replace matches! with == where possible, for shorter code and faster compilation.

Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added A-ast Area - AST A-transformer Area - Transformer / Transpiler C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior labels Mar 24, 2025
@overlookmotel overlookmotel marked this pull request as ready for review March 24, 2025 10:26
@overlookmotel overlookmotel requested a review from Dunqing as a code owner March 24, 2025 10:26
@overlookmotel overlookmotel marked this pull request as draft March 24, 2025 10:26
@codspeed-hq
Copy link

codspeed-hq bot commented Mar 24, 2025

CodSpeed Instrumentation Performance Report

Merging #10013 will not alter performance

Comparing 03-22-refactor_ast_methods_for_fieldless_enums_take_self_not_self_remove_unnecessary_matches_ (a2b03d3) with main (5f45005)

Summary

✅ 33 untouched benchmarks

@overlookmotel overlookmotel marked this pull request as ready for review March 24, 2025 11:07
@overlookmotel
Copy link
Member Author

Uncontroversial change, and no difference on benchmarks (as expected because these methods should be inlined anyway), so merging without review.

@overlookmotel overlookmotel added the 0-merge Merge with Graphite Merge Queue label Mar 24, 2025
Copy link
Member Author

overlookmotel commented Mar 24, 2025

Merge activity

  • Mar 24, 7:08 AM EDT: The merge label '0-merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Mar 24, 7:08 AM EDT: A user added this pull request to the Graphite merge queue.
  • Mar 24, 7:15 AM EDT: A user merged this pull request with the Graphite merge queue.

…remove unnecessary `matches!` (#10013)

Small refactor. Fieldless enums are `Copy`, so it's pointless passing references to them (`&self`) into methods. Pass `self` instead.

Additionally, replace `matches!` with `==` where possible, for shorter code and faster compilation.
@graphite-app graphite-app bot force-pushed the 03-22-refactor_ast_methods_for_fieldless_enums_take_self_not_self_remove_unnecessary_matches_ branch from 04c5362 to a2b03d3 Compare March 24, 2025 11:09
@graphite-app graphite-app bot merged commit a2b03d3 into main Mar 24, 2025
27 checks passed
@graphite-app graphite-app bot deleted the 03-22-refactor_ast_methods_for_fieldless_enums_take_self_not_self_remove_unnecessary_matches_ branch March 24, 2025 11:15
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ast Area - AST A-transformer Area - Transformer / Transpiler C-cleanup Category - technical debt or refactoring. Solution not expected to change behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants