diff --git a/utils/grid/lib.rs b/utils/grid/lib.rs index daed417..f2fa866 100644 --- a/utils/grid/lib.rs +++ b/utils/grid/lib.rs @@ -452,7 +452,7 @@ impl Grid { } /// Return an iterator over the 8 neighbours of c. The iterator skips neighbouring positions outside of the grid. - pub fn adjacent_iter(&self, c: &C) -> OffsetsIter { + pub fn adjacent_iter<'a, C: AsCoord2d + Copy>(&'a self, c: &'a C) -> OffsetsIter<'a, T> { OffsetsIter { grid: self, origin: c.to_coord(), @@ -462,7 +462,7 @@ impl Grid { } /// Return an iterator over the 4 cardinal neighbours of c. The iterator skips neighbouring positions outside of the grid. - pub fn cardinal_iter(&self, c: &C) -> OffsetsIter { + pub fn cardinal_iter<'a, C: AsCoord2d + Copy>(&'a self, c: &'a C) -> OffsetsIter<'a, T> { OffsetsIter { grid: self, origin: c.to_coord(),