Check If A Value Is In A Vec In Rust
February 2025
Output:
found it
Alternative Method
The above doesn't work in every case (e.g. if it's a Vec<String> looking for a &str.
An alternate approach it to use .any() to look for matches:
Output:
found it
end of line