Skip to content

Conversation

@adamnemecek
Copy link

No description provided.

@epage
Copy link
Member

epage commented Jul 1, 2025

Could you say what the goal of this PR? Its title "refactoring", but what problem are you trying to address with this? Ideally, each commit would explain what it is trying to accomplish and why.

@adamnemecek
Copy link
Author

It makes some of the things more idiomatic and tries to remove some repetitions by e.g. merging arms of switch statements.

@epage
Copy link
Member

epage commented Jul 1, 2025

It makes some of the things more idiomatic

This is a very general statement. Being specific could help.

If this is referring to use_self, it might be worth instead making a PR against tries to remove some repetitions by e.g. merging arms of switch statements. to add it to the [workspace.lints.clippy] table and then it will eventually be disseminated across all of my projects.

tries to remove some repetitions by e.g. merging arms of switch statements.

As for what might be repetition, it is instead replaced with

  • More complex expressions
  • More difficult to compare with each other match statements

@adamnemecek
Copy link
Author

adamnemecek commented Jul 1, 2025

I believe that right now you can only call use_self from the CLI since it’s still in the clippy nursery.

@epage
Copy link
Member

epage commented Jul 1, 2025

The [lints] table is literally translated to CLI calls (I implemented it).

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.

2 participants