Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fn match_string(arg: &Option<String>) -> bool {
- match arg.into_iter().map(|arg| arg.as_ref()).next() {
- Option::Some("hello world") => true,
- _ => false
- }
- }
- fn main() {
- let str = "hello world".to_string();
- println!("foo, {}", match_string(&Some(str)));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement