Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "A function only searches text during the call and stores nothing. Which ordinary parameter type states that contract most directly?" on CodeWiki (https://codewiki.com/practice/mcq/rust/strings/choose-borrowed-parameter/).
Context (verbatim from the page):
"""
A function only searches text during the call and stores nothing. Which ordinary parameter type states that contract most directly?
&str
String
&mut String
Vec<char>
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in Rust. Where you are unsure, say so.