mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 00:47:16 +00:00
explicit_ty_bound
code golf
This commit is contained in:
parent
36b2685977
commit
d38175f271
1 changed files with 1 additions and 2 deletions
|
@ -88,10 +88,9 @@ impl<'a, 'tcx> NumericFallbackVisitor<'a, 'tcx> {
|
||||||
fn check_lit(&self, lit: &Lit, lit_ty: Ty<'tcx>, emit_hir_id: HirId) {
|
fn check_lit(&self, lit: &Lit, lit_ty: Ty<'tcx>, emit_hir_id: HirId) {
|
||||||
if_chain! {
|
if_chain! {
|
||||||
if !in_external_macro(self.cx.sess(), lit.span);
|
if !in_external_macro(self.cx.sess(), lit.span);
|
||||||
if let Some(explicit_ty_bounds) = self.ty_bounds.last();
|
if matches!(self.ty_bounds.last(), Some(ExplicitTyBound(false)));
|
||||||
if matches!(lit.node,
|
if matches!(lit.node,
|
||||||
LitKind::Int(_, LitIntType::Unsuffixed) | LitKind::Float(_, LitFloatType::Unsuffixed));
|
LitKind::Int(_, LitIntType::Unsuffixed) | LitKind::Float(_, LitFloatType::Unsuffixed));
|
||||||
if !explicit_ty_bounds.0;
|
|
||||||
then {
|
then {
|
||||||
let (suffix, is_float) = match lit_ty.kind() {
|
let (suffix, is_float) = match lit_ty.kind() {
|
||||||
ty::Int(IntTy::I32) => ("i32", false),
|
ty::Int(IntTy::I32) => ("i32", false),
|
||||||
|
|
Loading…
Reference in a new issue