clock_tui/clock_text/point.rs
1use std::ops;
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq)]
4pub struct Point(pub u16, pub u16);
5
6impl ops::Add<&Point> for Point {
7 type Output = Point;
8
9 fn add(self, other: &Point) -> Point {
10 Point(self.0 + other.0, self.1 + other.1)
11 }
12}
13
14impl ops::Mul<u16> for Point {
15 type Output = Point;
16
17 fn mul(self, other: u16) -> Point {
18 Point(self.0 * other, self.1 * other)
19 }
20}