Allow the if_not_else Clippy lint

Specifically, the [`if_not_else`] lint will sometimes flag
code to change the order of `if` and `else` bodies if this
would allow a `!` to be removed. While perhaps tasteful in
some cases, there are many cases in my experience where this
bows to other competing concerns that impact readability.
(Such as the relative sizes of the `if` and `else` bodies,
or perhaps an ordering that just makes the code flow in a
more natural way.)

[`if_not_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#/if_not_else
This commit is contained in:
Andrew Gallant 2025-09-09 08:15:15 -04:00 committed by Andrew Gallant
parent 61f906d8e7
commit 25853e2377
5 changed files with 8 additions and 4 deletions

View file

@ -790,7 +790,6 @@ impl Session {
// But while this seemed to work for the project root, it
// simply wouldn't result in any file notifications for changes
// to files outside of the project root.
#[allow(clippy::if_not_else)] // no! it reads better this way ---AG
let watchers = if !self.client_capabilities().supports_relative_file_watcher() {
tracing::warn!(
"Your LSP client doesn't support file watching outside of project: \