Skip to content

Commit d121383

Browse files
author
wayslog
committed
bug fixed: comment conflict with syntax highlight
1 parent 030f90a commit d121383

1 file changed

Lines changed: 16 additions & 18 deletions

File tree

06-flow/06-01-comment.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,22 @@ let y = 6; // 创建另一个绑定
2121

2222
文档注释使用 ```///```,一般用于函数或结构体(字段)的说明,置于要说明的对象上方。文档注释内部可使用markdown格式的标记语法,可用于 rustdoc 工具的自动文档提取。
2323

24-
```rust
25-
/// Adds one to the number given.
26-
///
27-
/// # Examples
28-
///
29-
/// ```
30-
/// let five = 5;
31-
///
32-
/// assert_eq!(6, add_one(5));
33-
/// # fn add_one(x: i32) -> i32 {
34-
/// # x + 1
35-
/// # }
36-
/// ```
37-
fn add_one(x: i32) -> i32 {
38-
x + 1
39-
}
40-
```
24+
/// Adds one to the number given.
25+
///
26+
/// # Examples
27+
///
28+
/// ```
29+
/// let five = 5;
30+
///
31+
/// assert_eq!(6, add_one(5));
32+
/// # fn add_one(x: i32) -> i32 {
33+
/// # x + 1
34+
/// # }
35+
/// ```
36+
fn add_one(x: i32) -> i32 {
37+
x + 1
38+
}
39+
4140

4241
## 模块注释
4342

@@ -61,6 +60,5 @@ Rust 也支持兼容 C 的块注释写法:`/* */`。但是不推荐使用,
6160
/*
6261
let x = 42;
6362
println!("{}", x);
64-
6563
*/
6664
```

0 commit comments

Comments
 (0)