daily pastebin goal
27%
SHARE
TWEET

Untitled

a guest May 16th, 2018 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. fn doubled_iterator<'a>(slice: &'a[u32]) -> impl Iterator<Item=u32> + '_ {
  2.     return slice.iter().map(|x| { return x * 2 });
  3. }
  4.  
  5. fn main() {
  6.     let numbers = vec![1, 2, 3];
  7.    
  8.     for number in doubled_iterator(&numbers) {
  9.         println!("{}", number);
  10.     }
  11. }
  12.  
  13. fn test<'a>(slice: &'a[u32]) -> &'a [u32] {
  14.     slice
  15. }
  16.  
  17. fn testa(slice: &[u32]) -> &[u32] {
  18.     slice
  19. }
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