don't use std::iter::Step on Coord

This commit is contained in:
facile pop culture reference 2026-07-30 14:51:45 +03:00
parent 49dcb4f3ba
commit 33e135c614
2 changed files with 3 additions and 3 deletions

View file

@ -22,7 +22,7 @@ pub trait Coord: Send + Sync + Copy
+ From<u16> + Into<u16> + From<u16> + Into<u16>
+ Into<usize> + Into<usize>
+ Into<f64> + Into<f64>
+ std::iter::Step //+ std::iter::Step
{ {
/// Zero in own type. /// Zero in own type.
fn zero () -> Self { 0.into() } fn zero () -> Self { 0.into() }

View file

@ -8,7 +8,7 @@ pub trait Lrtb<N: Coord>: Xywh<N> {
// FIXME: factor origin // FIXME: factor origin
[self.x(), self.y(), self.x()+self.w(), self.y()+self.h()] [self.x(), self.y(), self.x()+self.w(), self.y()+self.h()]
} }
fn iter_x (&self) -> impl Iterator<Item = N> where Self: HasOrigin { fn iter_x (&self) -> std::ops::Range<N> where Self: HasOrigin {
self.x_west()..self.x_east() self.x_west()..self.x_east()
} }
fn x_west (&self) -> N where Self: HasOrigin { fn x_west (&self) -> N where Self: HasOrigin {
@ -26,7 +26,7 @@ pub trait Lrtb<N: Coord>: Xywh<N> {
fn x_center (&self) -> N where Self: HasOrigin { fn x_center (&self) -> N where Self: HasOrigin {
todo!() todo!()
} }
fn iter_y (&self) -> impl Iterator<Item = N> where Self: HasOrigin { fn iter_y (&self) -> std::ops::Range<N> where Self: HasOrigin {
self.y_north()..self.y_south() self.y_north()..self.y_south()
} }
fn y_north (&self) -> N where Self: HasOrigin { fn y_north (&self) -> N where Self: HasOrigin {