Skip to content

bool_assert_comparison improve the suggestion to include the expression  #7598

Closed
@xFrednet

Description

@xFrednet

The lint message for the bool_assert_comparison lint currently look like this:

warning: used `assert_eq!` with a literal bool
 --> src/main.rs:5:5
  |
5 |     assert_eq!(some_bool_expression, false);
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace it with: `assert!(..)`

I think the suggestion can be improved to include the actual expression that should be put in the assert! instead of just having the placeholder ...

The text for the suggestion can be retrieved with functions from clippy_utils::source.

Metadata

Metadata

Assignees

Labels

C-enhancementCategory: Enhancement of lints, like adding more cases or adding help messagesL-styleLint: Belongs in the style lint groupgood first issueThese issues are a good way to get started with Clippy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions