Skip to content

[clippy] use is_multiple_of instead of "foo % 3 == 0"#10457

Open
Montel wants to merge 1 commit intoslint-ui:masterfrom
Montel:use_is_multiple_of
Open

[clippy] use is_multiple_of instead of "foo % 3 == 0"#10457
Montel wants to merge 1 commit intoslint-ui:masterfrom
Montel:use_is_multiple_of

Conversation

@Montel
Copy link
Contributor

@Montel Montel commented Jan 16, 2026

No description provided.

match list_item_type {
Some(ListItemType::Unordered) => {
if indentation % 3 == 0 {
if indentation.is_multiple_of(3) {
Copy link
Member

Choose a reason for hiding this comment

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

This is not consistent with the condition two lines bellow. But OK

Copy link
Member

Choose a reason for hiding this comment

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

I'd also prefer to keep it consistent. Another option would be store the remainder of the division in a variable and then use that in the if - for readability.

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.

3 participants