Minor simplification
Apply eta-reduction on map to simplify code and make the style more consistent
This commit is contained in:
parent
c04e65dbc5
commit
4a85755756
1 changed files with 1 additions and 1 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue