Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. fn publish(book: &Vec<String>) {
  2. println!("{:?}", book);
  3. }
  4.  
  5. fn main() {
  6. let mut book = Vec::new();
  7. book.push("hello".into());
  8. book.push("world".into());
  9. {
  10. let p = &mut book;
  11. println!("{}", book.len());
  12. //book.push("!".into());
  13. //p.push("!".into());
  14. publish(p)
  15. }
  16. //book.push("goodbye".into());
  17. //publish(&book);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement