Closed npetrangelo closed 1 year ago
I'm not sure there's really an issue with this library or Rust itself, but it is very unclear what the idiomatic way is to loop over this range with a custom step.
I found a solution, although I wish I could directly cast a Range
let w = app.window_rect().w() as i32;
for i in (-w..w).step_by(100) {
draw.ellipse()
.color(RED)
.x_y(i as f32 - 200.0, -100.0);
}
I am trying to draw a row of ellipses and this for loop will not compile, complaining that the returned
pub struct Range<S = scalar::Default>
does not satisfy the Iterator trait bound, even though to my understanding, Iterator is supposed to be implemented for all Ranges.The rest of my project can be found here.