pubfnlikes(names:&[&str])->String{matchnames{[]=>String::from("no one likes this"),[a]=>format!("{} likes this",a),[a,b]=>format!("{} and {} like this",a,b),[a,b,c]=>format!("{}, {} and {} like this",a,b,c),[a,b,..]=>format!("{}, {} and {} others like this",a,b,names.len()-2),}}
We're a place where coders share, stay up-to-date and grow their careers.
Rust: