SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 53 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fn test(elements: &mut [i32], exit: bool) {
  2.     if exit {
  3.         return
  4.     }
  5.     for element in elements.iter_mut() {
  6.         *element = 1;
  7.         test(elements, true);
  8.         *element = 0;
  9.     }
  10. }
  11.  
  12. fn main () {
  13.     let mut data = [0, 1, 2];
  14.     test(&mut data, false);
  15. }
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