Merge pull request #1577 from Zolyn/fix/typo

fix: some typos
main
Sunface 1 week ago committed by GitHub
commit fd23a127d0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -62,7 +62,7 @@ async fn process(socket: TcpStream) {
现在运行我们的简单服务器 : 现在运行我们的简单服务器 :
```shel ```shell
cargo run cargo run
``` ```

@ -95,7 +95,7 @@ impl Drop for HasTwoDrops {
原因在于Rust 自动为几乎所有类型都实现了 `Drop` 特征,因此就算你不手动为结构体实现 `Drop`,它依然会调用默认实现的 `drop` 函数,同时再调用每个字段的 `drop` 方法,最终打印出: 原因在于Rust 自动为几乎所有类型都实现了 `Drop` 特征,因此就算你不手动为结构体实现 `Drop`,它依然会调用默认实现的 `drop` 函数,同时再调用每个字段的 `drop` 方法,最终打印出:
```cnosole ```console
Dropping HasDrop1! Dropping HasDrop1!
Dropping HasDrop2! Dropping HasDrop2!
``` ```

@ -15,9 +15,9 @@ fn greet(name: String) {
} }
``` ```
`greet` 函数接受一个字符串类型的 `name` 参数,然后打印到终端控制台中,非常好理解,你们猜猜,这段代码能否通过编译? `greet` 函数接受字符串类型的 `name` 参数,打印到终端控制台中,非常好理解。但大家猜猜,这段代码能否通过编译?
```conole ```console
error[E0308]: mismatched types error[E0308]: mismatched types
--> src/main.rs:3:11 --> src/main.rs:3:11
| |

Loading…
Cancel
Save