pub fn test_generics_fn<T>(v:&[T])->&T
where T : std::cmp::PartialOrd
{
let mut max = &v[0];
for e in v
{
if e > max
{
max = e;
}
}
max
}
pub fn test_generics_fn1<T>(v:&[T])->T
where T : std::cmp::PartialOrd+core::marker::Copy
{
let mut max = v[0];
for e in v
{
if *e > max
{
max = *e;
}
}
max
}