use crate::{Angle, ConstInit, Debug, FmtResult, Formatter, Ordering};
impl<T: Clone> Clone for Angle<T> {
fn clone(&self) -> Self {
Self::new(self.turn.clone())
}
}
impl<T: Copy> Copy for Angle<T> {}
impl<T: Default> Default for Angle<T> {
fn default() -> Self {
Self::new(T::default())
}
}
impl<T: ConstInit> ConstInit for Angle<T> {
const INIT: Self = { Self::new(T::INIT) };
}
impl<T: Debug> Debug for Angle<T> {
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult<()> {
write!(f, "Angle({:?})", self.turn)
}
}
impl<T: PartialEq> PartialEq for Angle<T> {
fn eq(&self, other: &Self) -> bool {
self.turn == other.turn
}
}
impl<T: Eq> Eq for Angle<T> {}
impl<T: PartialOrd> PartialOrd for Angle<T> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.turn.partial_cmp(&other.turn)
}
}
impl<T: Ord> Ord for Angle<T> {
fn cmp(&self, other: &Self) -> Ordering {
self.turn.cmp(&other.turn)
}
}