Skip to content

Commit

Permalink
Merge #631
Browse files Browse the repository at this point in the history
631: Remove clippy warnings. #630 r=frewsxcv a=martinfrances107

- [x ] I agree to follow the project's [code of conduct](https://github.com/georust/geo/blob/master/CODE_OF_CONDUCT.md).
- [ x] I added an entry to `CHANGES.md` if knowledge of this change could be valuable to users.
---

Minor fixup: Removes clippy warnings.

Co-authored-by: Martin <martinfrances107@hotmail.com>
  • Loading branch information
bors[bot] and martinfrances107 committed Feb 22, 2021
2 parents e3096c0 + 6aec3e0 commit a8c2f16
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions geo-types/src/line_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ impl<T: CoordNum> LineString<T> {
/// );
/// assert!(lines.next().is_none());
/// ```
pub fn lines<'a>(&'a self) -> impl ExactSizeIterator + Iterator<Item = Line<T>> + 'a {
pub fn lines(&'_ self) -> impl ExactSizeIterator + Iterator<Item = Line<T>> + '_ {
self.0.windows(2).map(|w| {
// slice::windows(N) is guaranteed to yield a slice with exactly N elements
unsafe { Line::new(*w.get_unchecked(0), *w.get_unchecked(1)) }
})
}

/// An iterator which yields the coordinates of a `LineString` as `Triangle`s
pub fn triangles<'a>(&'a self) -> impl ExactSizeIterator + Iterator<Item = Triangle<T>> + 'a {
pub fn triangles(&'_ self) -> impl ExactSizeIterator + Iterator<Item = Triangle<T>> + '_ {
self.0.windows(3).map(|w| {
// slice::windows(N) is guaranteed to yield a slice with exactly N elements
unsafe {
Expand Down

0 comments on commit a8c2f16

Please sign in to comment.