2023-05-27 15:14:48 +00:00
|
|
|
struct Hello {
|
|
|
|
x: i32,
|
|
|
|
y: i32,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn test(x: Hello) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2023-05-27 15:22:07 +00:00
|
|
|
fn works(x: i64) -> i64 {
|
2023-06-09 15:35:48 +00:00
|
|
|
let z = 0i64;
|
2023-06-11 10:07:15 +00:00
|
|
|
if 2i64 == x {
|
2023-06-09 15:35:48 +00:00
|
|
|
z = x * 2i64;
|
2023-05-27 15:22:07 +00:00
|
|
|
} else {
|
2023-06-09 15:35:48 +00:00
|
|
|
z = x * 3i64;
|
2023-05-27 15:22:07 +00:00
|
|
|
}
|
|
|
|
return z;
|
2023-05-27 15:14:48 +00:00
|
|
|
}
|
|
|
|
|
2023-05-27 15:22:07 +00:00
|
|
|
fn main() -> i64 {
|
2023-06-09 15:35:48 +00:00
|
|
|
let y = 2i64;
|
2023-05-27 15:14:48 +00:00
|
|
|
let z = y;
|
|
|
|
return works(z);
|
2023-05-14 16:11:38 +00:00
|
|
|
}
|