Skip to content

Suggest replacing hand made integer rotations with rotate_right/rotate_left #6861

Closed
@leonardo-m

Description

@leonardo-m

I think Clippy should suggest to replace integer rotations like:

pub fn rol24a(x: u32) -> u32 {
    (x >> 8) | (x << 24)
}

With calls to rotation methods rotate_right or rotate_left:

pub fn rol24b(x: u32) -> u32 {
    x.rotate_right(8)
}

Metadata

Metadata

Assignees

Labels

A-lintArea: New lintsgood 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