use std::ops::{Add, AddAssign, Mul};
+pub type Nanoseconds = u64;
+
#[macro_export]
macro_rules! point {
( $x:expr, $y:expr ) => {
};
}
-#[derive(Debug, Copy, Clone, PartialEq)]
+#[derive(Debug, Default, Copy, Clone, PartialEq)]
pub struct Point2D<T> {
pub x: T,
pub y: T,
}
}
+impl<T> From<(T, T)> for Point2D<T> {
+ fn from(item: (T, T)) -> Self {
+ Point2D {
+ x: item.0,
+ y: item.1,
+ }
+ }
+}
+
#[macro_export]
macro_rules! rect {
( $x:expr, $y:expr ) => {