25 lines
295 B
Rust
25 lines
295 B
Rust
|
|
fn main() {
|
||
|
|
let x = 42
|
||
|
|
let y = vec![1, 2,
|
||
|
|
println!("{}", x
|
||
|
|
|
||
|
|
fn missing_type(x) -> i32 {
|
||
|
|
x
|
||
|
|
}
|
||
|
|
|
||
|
|
match x {
|
||
|
|
1 => println!("one"),
|
||
|
|
2 => println!("two"),
|
||
|
|
}
|
||
|
|
|
||
|
|
struct Point {
|
||
|
|
x: i32,
|
||
|
|
y: i32,
|
||
|
|
}
|
||
|
|
|
||
|
|
impl Point {
|
||
|
|
fn new(x: i32, y: i32 -> Self {
|
||
|
|
Self { x, y }
|
||
|
|
}
|
||
|
|
}
|