Trait (computer programming): Difference between revisions

Content deleted Content added
m ce
Line 186:
// type T must have the "Ord" trait
// so that ">" and "<" operations can be done
fn get_maxmax<T: Ord>(a: &[T]) -> Option<&T> {
let mut result = a.getfirst(0)?;
for n in a {
if *n > *result {