devela/num/geom/shape/angle/impl/
core_traits.rsuse crate::{Angle, ConstDefault, Debug, FmtResult, Formatter, Ordering};
impl<T: Clone> Clone for Angle<T> {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
impl<T: Copy> Copy for Angle<T> {}
impl<T: Default> Default for Angle<T> {
fn default() -> Self {
Self(T::default())
}
}
impl<T: ConstDefault> ConstDefault for Angle<T> {
const DEFAULT: Self = { Self(T::DEFAULT) };
}
impl<T: Debug> Debug for Angle<T> {
fn fmt(&self, f: &mut Formatter<'_>) -> FmtResult<()> {
write!(f, "Angle({:?})", self.0)
}
}
impl<T: PartialEq> PartialEq for Angle<T> {
fn eq(&self, other: &Self) -> bool {
self.0 == other.0
}
}
impl<T: Eq> Eq for Angle<T> {}
impl<T: PartialOrd> PartialOrd for Angle<T> {
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.0.partial_cmp(&other.0)
}
}
impl<T: Ord> Ord for Angle<T> {
fn cmp(&self, other: &Self) -> Ordering {
self.0.cmp(&other.0)
}
}