Advertisement
dd0x68

Untitled

May 26th, 2016
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Rust 0.51 KB | None | 0 0
  1. fn walk(indent: usize, handle: Handle) -> Vec<String> {
  2.     let mut resource_list = vec!();
  3.     ...
  4.         resource_list.push(replace(&mut attr.value.to_string(), String::new()));
  5.     ...
  6.    
  7.     for i in resource_list.iter(){      //prints as expected
  8.         println!("{}", i);
  9.     }
  10.  
  11.     resource_list
  12. }
  13.  
  14.  
  15.  
  16. fn main() {
  17.     let resource_list = walk(0, dom.document);
  18.    
  19.     println!("{}", resource_list.len());    //0
  20.     for i in resource_list.iter(){          //doesn't print anything
  21.         println!("{}", i);
  22.     }
  23.    
  24.  
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement