Skip to content

Commit

Permalink
Minor simplification
Browse files Browse the repository at this point in the history
Apply eta-reduction on map to simplify code and make the style more
consistent
  • Loading branch information
s-cerevisiae committed Jan 11, 2025
1 parent c04e65d commit 4a85755
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion compiler/rustc_lint/src/types/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ fn get_type_suggestion(t: Ty<'_>, val: u128, negative: bool) -> Option<&'static
ty::Uint(ty::UintTy::Usize) | ty::Int(ty::IntTy::Isize) => None,
ty::Uint(_) => Some(Integer::fit_unsigned(val).uint_ty_str()),
ty::Int(int) => {
let signed = literal_to_i128(val, negative).map(|v| Integer::fit_signed(v));
let signed = literal_to_i128(val, negative).map(Integer::fit_signed);
if negative {
signed.map(Integer::int_ty_str)
} else {
Expand Down

0 comments on commit 4a85755

Please sign in to comment.