clippy::identity_op for int.pow(1)

Open
#14,206 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
rust
Domain
tooling

Research direction

The issue names the identity_op Clippy lint but no files or tests. Start by locating that lint and its existing test coverage, then determine how integer pow(1) cases are represented; done means the lint reliably identifies those cases with appropriate tests.

Written by the indexing model from the issue text.

Description

A-lint
What it does

I suggest to extend the identity_op clippy lint to spot cases like x.pow(1).

Advantage

No response

Drawbacks

No response

Example
<code>

Could be written as:

<code>
Dominant language
Rust
Stars
13.5k
Forks
2.2k
Avg merge
2d 10h
Merged PRs (30d)
32

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from rust-lang/rust-clippy

All issues in rust-lang/rust-clippy

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.