mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Style: forbid .zip and .chain (#8188)
The `zip(a, b)` variant produces clearer code imho. Downside: added dependency on `itertools`
This commit is contained in:
@@ -489,7 +489,7 @@ mod test {
|
||||
} else {
|
||||
// There will be small rounding errors whenever the alpha is not 0 or 255,
|
||||
// because we multiply and then unmultiply the alpha.
|
||||
for (&a, &b) in in_rgba.iter().zip(out_rgba.iter()) {
|
||||
for (&a, &b) in std::iter::zip(&in_rgba, &out_rgba) {
|
||||
assert!(a.abs_diff(b) <= 3, "{in_rgba:?} != {out_rgba:?}");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -336,7 +336,7 @@ mod test {
|
||||
} else {
|
||||
// There will be small rounding errors whenever the alpha is not 0 or 255,
|
||||
// because we multiply and then unmultiply the alpha.
|
||||
for (&a, &b) in in_rgba.iter().zip(out_rgba.iter()) {
|
||||
for (&a, &b) in std::iter::zip(&in_rgba, &out_rgba) {
|
||||
assert!(a.abs_diff(b) <= 3, "{in_rgba:?} != {out_rgba:?}");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user