mirror of
https://github.com/RustyCab/LearnRustEasy.git
synced 2026-11-02 21:44:12 +08:00
Update chapter_2.md
This commit is contained in:
@@ -114,8 +114,9 @@ Rust在系统工具和实用程序开发中也表现出色。Rust编写的工具
|
|||||||
1. 对于macOS和Linux用户
|
1. 对于macOS和Linux用户
|
||||||
|
|
||||||
通过如下命令进行安装:
|
通过如下命令进行安装:
|
||||||
|
```
|
||||||
```curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh```
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
||||||
|
```
|
||||||
|
|
||||||
2. 对于Windows用户
|
2. 对于Windows用户
|
||||||
|
|
||||||
@@ -144,7 +145,7 @@ cargo new hello_world
|
|||||||
```
|
```
|
||||||
|
|
||||||
创建后,可以看到整个目录的结构如下:
|
创建后,可以看到整个目录的结构如下:
|
||||||

|

|
||||||
其中Cargo.toml是项目的配置文件,src为源代码目录,main.rs为主程序文件。
|
其中Cargo.toml是项目的配置文件,src为源代码目录,main.rs为主程序文件。
|
||||||
|
|
||||||
### 2.3.2 编写程序
|
### 2.3.2 编写程序
|
||||||
@@ -166,7 +167,7 @@ cargo run
|
|||||||
```
|
```
|
||||||
运行结果如下:
|
运行结果如下:
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
### 2.3.4 理解Rust源码的基本结构
|
### 2.3.4 理解Rust源码的基本结构
|
||||||
下面简单介绍Rust源码的结构。
|
下面简单介绍Rust源码的结构。
|
||||||
|
|||||||
Reference in New Issue
Block a user