Skip to content

Manual clippy fixes#1111

Open
lionel- wants to merge 29 commits intotask/clippy-unsafefrom
task/clippy-manual
Open

Manual clippy fixes#1111
lionel- wants to merge 29 commits intotask/clippy-unsafefrom
task/clippy-manual

Conversation

@lionel-
Copy link
Contributor

@lionel- lionel- commented Mar 12, 2026

Branched from #1108
Progress towards #1104

Main lints fixed:

  • Too many arguments
  • Unnecessary try_ conversions (can just use non-failing conversions)
  • Large enum variants. Sometimes fixed by boxing, sometimes by disabling the lint.
  • Use &str instead of &String, &Path instead of &PathBuf, &[] instead of &Vec
  • Clippy doesn't like uppercase variants like EOF, so they've become e.g. EndOfFile
  • Removed common prefixes/suffixes from enum variants. I added an opt out for the LSP notification enum so we can keep the Did prefix, e.g. KernelNotification::DidOpenVirtualDocument.
  • into_ methods must take self. Renamed those that didn't, e.g. Dap::make_variables() which is not really an "into" method strictly speaking.
  • Simplified unnecessary uses of match
  • Use .is_some() or is_err() methods when applicable
  • Use ? instead of explicit return when applicable
  • Build regex in lazy globals

}

/// Handler implementations provided by the language runtime.
pub struct Handlers {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These new structs fix the "too many arguments" lint.

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