I\'m trying to implement a method:
struct Point { x: T, y: T, } struct Line { start: Point, end: Point, } i
You need to add a type parameter to the impl:
impl Line<f64> { fn length(&self) -> f64 { let dx: f64 = self.start.x - self.end.x; let dy: f64 = self.start.y - self.end.y; (dx * dx + dy * dy).sqrt() } }