Fix some more basic clippy lints

This commit is contained in:
Lukas Wirth
2021-07-21 20:52:08 +02:00
parent 9485d6efba
commit dfdf6fd9f8
9 changed files with 22 additions and 29 deletions

View File

@@ -105,14 +105,12 @@ fn param(p: &mut Parser, m: Marker, flavor: Flavor) -> Variadic {
patterns::pattern(p);
if variadic_param(p) {
res = Variadic(true)
} else if p.at(T![:]) {
types::ascription(p)
} else {
if p.at(T![:]) {
types::ascription(p)
} else {
// test_err missing_fn_param_type
// fn f(x y: i32, z, t: i32) {}
p.error("missing type for function parameter")
}
// test_err missing_fn_param_type
// fn f(x y: i32, z, t: i32) {}
p.error("missing type for function parameter")
}
}
// test value_parameters_no_patterns
@@ -131,12 +129,10 @@ fn param(p: &mut Parser, m: Marker, flavor: Flavor) -> Variadic {
patterns::pattern_single(p);
if variadic_param(p) {
res = Variadic(true)
} else if p.at(T![:]) {
types::ascription(p)
} else {
if p.at(T![:]) {
types::ascription(p)
} else {
p.error("missing type for function parameter")
}
p.error("missing type for function parameter")
}
} else {
types::type_(p);