#[derive(Debug, Clone, Copy, PartialEq)]
pub struct Point {
pub x: f32,
pub y: f32,
}
impl Point {
pub fn new(x: f32, y: f32) -> Self {
Self { x, y }
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn point_new_stores_coordinates() {
let p = Point::new(3.0, 4.0);
assert_eq!(p.x, 3.0);
assert_eq!(p.y, 4.0);
}
}