forked from StrafesNET/strafe-project
implement Debug + Display
This commit is contained in:
@ -47,6 +47,17 @@ macro_rules! impl_vector {
|
||||
}
|
||||
}
|
||||
|
||||
impl<const N:usize,T:core::fmt::Display> core::fmt::Display for Vector<N,T>{
|
||||
#[inline]
|
||||
fn fmt(&self,f:&mut core::fmt::Formatter)->Result<(),core::fmt::Error>{
|
||||
for elem in &self.array[0..N-1]{
|
||||
core::write!(f,"{}, ",elem)?;
|
||||
}
|
||||
// assume we will be using vectors of length 1 or greater
|
||||
core::write!(f,"{}",self.array.last().unwrap())
|
||||
}
|
||||
}
|
||||
|
||||
impl<const N:usize,T:Ord> Vector<N,T>{
|
||||
#[inline]
|
||||
pub fn min(self,rhs:Self)->Self{
|
||||
|
Reference in New Issue
Block a user