fn main() {
let arr = ["rust", "compiler", "documentation", "packages"];
let longest_string = arr.iter().max_by_key(|s| s.len()).copied();
match longest_string {
Some(s) => println!("{}", s),
None => println!("Array is empty"), // Where the array is empty
}
}
/*
run:
documentation
*/