Repository navigation
Expand file tree
/
Copy pathmain.rs
More file actions
126 lines (121 loc) · 3.75 KB
/
Copy pathmain.rs
File metadata and controls
126 lines (121 loc) · 3.75 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
///标准库的比较,Ordering枚举包含Less, Greater和Equal
///导入标准库的输入输出库
///引入rand库的Rng特质
use closures_syntax::*;
use collection_function::*;
use control_function::*;
use enum_data_type::*;
use generic_traits_lifetimes::*;
use iterator_demonstration::*;
use macro_syntax::*;
use match_syntax::*;
use method_syntax::*;
use other_function::*;
use panic_function::panic_function;
use point_function::*;
use simple_array_data_type::*;
use smart_point::*;
use struct_data_type::*;
use thread_syntax::*;
use variables_function::*;
pub mod closures_syntax;
pub mod collection_function;
pub mod control_function;
pub mod enum_data_type;
pub mod example_guessing_game;
pub mod generic_traits_lifetimes;
pub mod iterator_demonstration;
pub mod macro_syntax;
pub mod match_syntax;
pub mod method_syntax;
pub mod other_function;
pub mod panic_function;
pub mod point_function;
pub mod simple_array_data_type;
pub mod smart_point;
pub mod struct_data_type;
pub mod thread_syntax;
pub mod variables_function;
/// 引用和借用:https://dreamylost.cn/rust/Rust-Rust%E5%AD%A6%E4%B9%A0%E4%B9%8B%E5%BC%95%E7%94%A8%E4%B8%8E%E5%80%9F%E7%94%A8.html
/// 所有权:https://dreamylost.cn/rust/Rust-%E6%89%80%E6%9C%89%E6%9D%83.html
/// 切片:https://dreamylost.cn/rust/Rust-%E5%88%87%E7%89%87.html
/// main方法,引用了其他rs文件
fn main() {
println!("Hello, world!");
variables_function();
println!("====================");
simple_array_data_type();
println!("====================");
another_function(12);
println!("====================");
expr_function();
println!("====================");
println!("{}", five()); //打印字符串,不能直接println!(five())
println!("====================");
control_function();
println!("====================");
println!("斐波那契第20项是:{}", fib(20));
println!("====================");
println!("斐波那契第20项是:{}", fib_2(20));
println!("====================");
string_function();
println!("====================");
return_function();
println!("====================");
tuple_function();
println!("====================");
copy_function();
println!("====================");
point_function();
println!("====================");
try_change_function();
println!("====================");
empty_point_function();
println!("====================");
struct_data_type();
println!("====================");
method_syntax();
println!("====================");
enum_data_type();
println!("====================");
match_syntax();
match_syntax2();
println!("====================");
crate_function();
println!("====================");
collection_function();
println!("====================");
panic_function();
println!("====================");
largest_function();
println!("====================");
enum_generic();
println!("====================");
trait_function();
println!("====================");
closures_syntax();
println!("====================");
iterator_function();
println!("====================");
box_function();
println!("====================");
create_thread();
println!("====================");
join_thread();
println!("====================");
use_var_thread();
println!("====================");
channel_thread();
println!("====================");
send_multi_msg();
println!("====================");
copy_tx();
println!("====================");
mutex_thread();
println!("====================");
mutex_multi_thread();
println!("====================");
marco_function();
println!("====================");
//example_guessing_game();
}