Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #![allow(unused)]
- macro_rules! five_times {
- (
- $($x:expr), *) => {
- {let mut no = 5;
- $(
- no = no + $x;
- )*
- no
- }
- };
- }
- fn main() {
- struct User {
- name: String,
- }
- let mut array:[i32; 50] = [0; 50];
- println!("Hello, world! {:?}, {:?}", array[0], array[array.len() - 1]);
- let _test_user = User {
- name: String::from("test_user")
- };
- let _t = (1, 2);
- f_fn(&mut array);
- println!("{:?} user {:#?}, tupple {:#?}", array[0], _test_user.name, five_times!(5+10));
- }
- fn f_fn(_array: &mut [i32]) {
- let new_str = "New STR";
- println!("this is fn {:?}", new_str);
- _array[0] = 100;
- }
Add Comment
Please, Sign In to add comment