Slug: own-cow-01 · Paired reading: Chapters 5 and 11
Prompt
fn normalize(s: &str) -> Cow<'_, str> — if s is already lowercase
ASCII, return Cow::Borrowed(s); otherwise return an owned lowercased
String as Cow::Owned.
The curriculum, drills, tutor, and interviewer mode are for readers of Ace the Rust Interview. The code is printed in the Preface (Companion site access).
Don’t have the book yet? The landing page stays open — purchase unlocks this gym.
beginner · order 46
Slug: own-cow-01 · Paired reading: Chapters 5 and 11
fn normalize(s: &str) -> Cow<'_, str> — if s is already lowercase
ASCII, return Cow::Borrowed(s); otherwise return an owned lowercased
String as Cow::Owned.