Guest User

Untitled

a guest
Jan 17th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #![allow(unused)]
  2. macro_rules! five_times {
  3. (
  4. $($x:expr), *) => {
  5. {let mut no = 5;
  6. $(
  7. no = no + $x;
  8. )*
  9. no
  10. }
  11. };
  12. }
  13.  
  14.  
  15. fn main() {
  16.  
  17. struct User {
  18. name: String,
  19.  
  20. }
  21.  
  22. let mut array:[i32; 50] = [0; 50];
  23. println!("Hello, world! {:?}, {:?}", array[0], array[array.len() - 1]);
  24. let _test_user = User {
  25. name: String::from("test_user")
  26. };
  27. let _t = (1, 2);
  28. f_fn(&mut array);
  29. println!("{:?} user {:#?}, tupple {:#?}", array[0], _test_user.name, five_times!(5+10));
  30.  
  31. }
  32.  
  33. fn f_fn(_array: &mut [i32]) {
  34. let new_str = "New STR";
  35. println!("this is fn {:?}", new_str);
  36. _array[0] = 100;
  37. }
Add Comment
Please, Sign In to add comment