Pick the Shorter Slice
100 points
Implement shorter, which returns whichever of two string slices has fewer bytes. If tie; return b.
Required signature
pub fn shorter<'a>(a: &'a str, b: &'a str) -> &'a str
Visible tests
-
returns_the_shorter_one#[test] fn returns_the_shorter_one() { assert_eq!(shorter("hi", "hello"), "hi"); }
Your solution
Log in to submit a solution.