1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
pub fn title(){
println!("第2章:{}", "语言精要");
}
pub fn answer() -> (){
let a = 40;
let b = 2;
assert_eq!(sum(a, b), 42);
}
pub fn sum(a: i32, b: i32) -> i32 {
a + b
}
pub mod binding;
pub mod function;
pub mod control_flow;
pub mod collections;
pub mod primitives;
pub mod enums;
pub mod structs;
pub mod smart_pointer;
pub mod generics_trait;
pub mod errors_handle;
pub mod annotation;