File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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```
Original file line number Diff line number Diff line change 1+ {
2+ "lang" :" zh-cn"
3+ }
You can’t perform that action at this time.
0 commit comments