Lint: clippy's collapsible_match passes on Rust 1.95
cargo +1.95 clippy --workspace --all-targets --release -- -D warnings
stopped on seven `if` blocks that clippy wants folded into their match
arm (psd, text, effects x2, pdf x2, render). Each becomes a match guard.
The behaviour is unchanged: when a guard is false the value falls through
to arms that can't match it and then to `_ => {}`. The one exception is
the PDF PostScript calculator, where a `{` past the nesting limit would
fall through to the operator arm; it keeps its own no-op arm, so it is
still skipped rather than pushed as an operator.
This commit is contained in:
@@ -503,10 +503,8 @@ fn scan_runs(polys: &[(Vec<[f64; 2]>, bool, bool)], fill: u32, ew: f64, d: [f64;
|
||||
let entering = k % 2 == 0;
|
||||
let l = ew / sin;
|
||||
match mode {
|
||||
0 => {
|
||||
if entering && k + 1 < xs.len() {
|
||||
out.push((t, xs[k + 1].0));
|
||||
}
|
||||
0 if entering && k + 1 < xs.len() => {
|
||||
out.push((t, xs[k + 1].0));
|
||||
}
|
||||
1 => out.push((t - l * 0.5, t + l * 0.5)),
|
||||
2 => out.push(if entering { (t, t + l) } else { (t - l, t) }),
|
||||
|
||||
Reference in New Issue
Block a user