SHARE
TWEET

Untitled

a guest May 25th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fn main() {
  2.     let a = Option::Some("foo");
  3.     println!("{}", a.iter().all(|x| *x == "foo"));
  4.     println!("{}", a.iter().any(|x| *x == "foo"));
  5.     println!("{}", a.iter().all(|x| *x == "bar"));
  6.     println!("{}", a.iter().any(|x| *x == "bar"));
  7.     let b: Option<&str> = Option::None;
  8.     println!("{}", b.iter().all(|x| *x == "foo"));
  9.     println!("{}", b.iter().any(|x| *x == "foo"));
  10.     println!("{}", b.iter().all(|x| *x == "bar"));
  11.     println!("{}", b.iter().any(|x| *x == "bar"));
  12. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top