Type must be known in this context when using Iterator::sum [duplicate]
问题 This question already has an answer here : Type must be known in this context when using Iterator::collect (1 answer) Closed 3 years ago . I am trying to implement a trait that models the euclidean distance between 2 points in an n-dim space. The points are represented as Vec<u32> . pub trait Point { fn euclidean_to(&self, other: Vec<u32>) -> f64; } impl Point for Vec<u32> { fn euclidean_to(&self, other: Vec<u32>) -> f64 { (self.iter() .zip(other.iter()) .map(|(xa, xb): (&u32, &u32)| (xa - xb