Update chapter_2.md

This commit is contained in:
令狐一冲
2023-05-17 10:52:49 +08:00
committed by GitHub
parent 7141ad708a
commit ac002c5268

View File

@@ -114,8 +114,9 @@ Rust在系统工具和实用程序开发中也表现出色。Rust编写的工具
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用户
@@ -144,7 +145,7 @@ cargo new hello_world
```
创建后,可以看到整个目录的结构如下:
![目录结构](assets/62.PNG)
![目录结构](../assets/62.PNG)
其中Cargo.toml是项目的配置文件src为源代码目录main.rs为主程序文件。
### 2.3.2 编写程序
@@ -166,7 +167,7 @@ cargo run
```
运行结果如下:
![运行结果](assets/63.png)
![运行结果](../assets/63.png)
### 2.3.4 理解Rust源码的基本结构
下面简单介绍Rust源码的结构。