equal
deleted
inserted
replaced
503 pub fn iter<'a>(&'a self) -> impl Iterator<Item = &Point> + 'a { |
503 pub fn iter<'a>(&'a self) -> impl Iterator<Item = &Point> + 'a { |
504 (&self.vertices[..self.edges_count()]).iter() |
504 (&self.vertices[..self.edges_count()]).iter() |
505 } |
505 } |
506 |
506 |
507 pub fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &mut Point> + 'a { |
507 pub fn iter_mut<'a>(&'a mut self) -> impl Iterator<Item = &mut Point> + 'a { |
|
508 let edges_count = self.edges_count(); |
508 let start = self.vertices.as_mut_ptr(); |
509 let start = self.vertices.as_mut_ptr(); |
509 let end = unsafe { start.add(self.vertices.len()) }; |
510 let end = unsafe { start.add(edges_count) }; |
510 PolygonPointsIteratorMut { |
511 PolygonPointsIteratorMut { |
511 source: self, |
512 source: self, |
512 start, |
513 start, |
513 end, |
514 end, |
514 } |
515 } |