Closed xamgore closed 1 year ago
.circular_tuple_windows() will produce the same amount of elements as the upstream iterator, so I believe the implementation should be pretty simple.
.circular_tuple_windows()
Speaking about the practical example, I want to convert a vector of 2D points to pairs of normalized vectors.
let vecs = shape .into_iter() .circular_tuple_windows::<(_, _)>() .map(|((x1, y1), (x2, y2)): (Point, Point)| (x2 - x1, y2 - y1) as Point) .circular_tuple_windows(); // trait `ExactSizeIterator` is not satisfied
@Philippe-Cholet what an excellent work, thank you so much! ❤️
@xamgore You are welcome. Thanks for pointing that out.
.circular_tuple_windows()
will produce the same amount of elements as the upstream iterator, so I believe the implementation should be pretty simple.Speaking about the practical example, I want to convert a vector of 2D points to pairs of normalized vectors.