I'm attempting to parallelise the Ramer–Douglas-Peucker line simplification algorithm by using Rayon's par_iter instead of iter : extern crate num_traits; use num_traits::{Float, ToPrimitive}; extern crate rayon; use self::rayon::prelude::*; #[derive(PartialEq, Clone, Copy, Debug)] pub struct Coordinate<T> where T: Float { pub x: T, pub y: T, } #[derive(PartialEq, Clone, Copy, Debug)] pub struct Point<T>(pub Coordinate<T>) where T: Float; impl<T> Point<T> where T: Float + ToPrimitive { pub fn new(x: T, y: T) -> Point<T> { Point(Coordinate { x: x, y: y }) } pub fn x(&self) -> T { self.0.x } pub