1fn main() {
2 println!("Hello, world!");
3}
4
5fn add(a: i32, b: i32) -> i32 {
6 a + b
7}
8
9struct Point {
10 x: f64,
11 y: f64,
12}
13
14enum Direction {
15 Up,
16 Down,
17 Left,
18 Right,
19}
20
21trait Describe {
22 fn describe(&self) -> String;
23}
24
25impl Describe for Point {
26 fn describe(&self) -> String {
27 format!("Point at ({}, {})", self.x, self.y)
28 }
29}
30
31const MAX_POINTS: u32 = 100;