daily pastebin goal
61%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let mut v = vec![1, 2, 3, 4, 5];
  2. let r = v
  3.     .get_mut(1..=2)
  4.     .map(|x| x.iter_mut().for_each(|y| *y *= 10));
  5. if r.is_some() {
  6.     println!("Succeed : {:?}", v);
  7. } else {
  8.     println!("Not Succeed. Do something here.");
  9. }
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