Auto merge of #8183 - alex-ozdemir:limit-ident, r=camsteffen
Limit the ``[`identity_op`]`` lint to integral operands. changelog: limit ``[`identity_op`]`` to integral operands In the ``[`identity_op`]`` lint, if the operands are non-integers, then the lint is likely wrong.
This commit is contained in:
commit
16ef044e72
4 changed files with 56 additions and 18 deletions
|
|
@ -168,6 +168,14 @@ impl Constant {
|
|||
None
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn peel_refs(mut self) -> Self {
|
||||
while let Constant::Ref(r) = self {
|
||||
self = *r;
|
||||
}
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// Parses a `LitKind` to a `Constant`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue