mirror of
https://github.com/storytold/AniCraft.git
synced 2026-12-01 02:24:23 +01:00
fix(lint): as_chunks instead of constant-size chunks_exact (clippy 1.99, fails CI on main too)
This commit is contained in:
1 parent
99ef1c3a9a
commit
16ab577d12
2 files changed
+4
-4
No files matched your search
@@ -610,8 +610,8 @@ impl<'a> Builder<'a> {
|
||||
"polyline" | "polygon" => {
|
||||
let n = numbers(el.attr("points").unwrap_or(""));
|
||||
let mut p = Path::new();
|
||||
for (i, xy) in n.chunks_exact(2).enumerate() {
|
||||
let q = Vec2::new(xy.first().copied().unwrap_or(0.0), xy.get(1).copied().unwrap_or(0.0));
|
||||
for (i, &[x, y]) in n.as_chunks::<2>().0.iter().enumerate() {
|
||||
let q = Vec2::new(x, y);
|
||||
if i == 0 { p.move_to(q) } else { p.line_to(q) };
|
||||
}
|
||||
if name == "polygon" && !p.is_empty() {
|
||||
|
||||
+2
-2
@@ -202,8 +202,8 @@ fn num(tag: &str, name: &str) -> f32 {
|
||||
fn points(tag: &str, close: bool) -> Option<Path> {
|
||||
let v: Vec<f32> = attr(tag, "points")?.split(|c: char| c.is_whitespace() || c == ',').filter_map(|t| t.parse().ok()).collect();
|
||||
let mut p = Path::new();
|
||||
for (i, xy) in v.chunks_exact(2).enumerate() {
|
||||
let q = Vec2::new(xy[0], xy[1]);
|
||||
for (i, &[x, y]) in v.as_chunks::<2>().0.iter().enumerate() {
|
||||
let q = Vec2::new(x, y);
|
||||
if i == 0 {
|
||||
p.move_to(q);
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user