mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 20:49:41 +00:00
Merge pull request #222 from Rackar/patch-1
add comments in char-bool-unit.md
This commit is contained in:
@ -3,6 +3,7 @@
|
|||||||
### 字符
|
### 字符
|
||||||
1. 🌟
|
1. 🌟
|
||||||
```rust, editable
|
```rust, editable
|
||||||
|
// 修改2处 `assert_eq!` 让代码工作
|
||||||
|
|
||||||
use std::mem::size_of_val;
|
use std::mem::size_of_val;
|
||||||
fn main() {
|
fn main() {
|
||||||
@ -18,7 +19,7 @@ fn main() {
|
|||||||
|
|
||||||
2. 🌟
|
2. 🌟
|
||||||
```rust, editable
|
```rust, editable
|
||||||
|
// 修改一行让代码正常打印
|
||||||
fn main() {
|
fn main() {
|
||||||
let c1 = "中";
|
let c1 = "中";
|
||||||
print_char(c1);
|
print_char(c1);
|
||||||
@ -33,7 +34,7 @@ fn print_char(c : char) {
|
|||||||
3. 🌟
|
3. 🌟
|
||||||
```rust, editable
|
```rust, editable
|
||||||
|
|
||||||
// make println! work
|
// 使成功打印
|
||||||
fn main() {
|
fn main() {
|
||||||
let _f: bool = false;
|
let _f: bool = false;
|
||||||
|
|
||||||
@ -94,4 +95,4 @@ fn main() {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
> 你可以在[这里](https://github.com/sunface/rust-by-practice)找到答案(在 solutions 路径下)
|
||||||
|
Reference in New Issue
Block a user