mirror of
https://github.com/RustyCab/LearnRustEasy.git
synced 2026-06-15 06:40:27 +08:00
Update chapter_3_4.md
This commit is contained in:
@@ -68,12 +68,12 @@ pub fn add_one(x: i32) -> i32 {
|
|||||||
/** `add_two` 将指定值加2
|
/** `add_two` 将指定值加2
|
||||||
|
|
||||||
|
|
||||||
```
|
\```
|
||||||
let arg = 5;
|
let arg = 5;
|
||||||
let answer = my_crate::add_two(arg);
|
let answer = my_crate::add_two(arg);
|
||||||
|
|
||||||
assert_eq!(7, answer);
|
assert_eq!(7, answer);
|
||||||
```
|
\```
|
||||||
*/
|
*/
|
||||||
pub fn add_two(x: i32) -> i32 {
|
pub fn add_two(x: i32) -> i32 {
|
||||||
x + 2
|
x + 2
|
||||||
|
|||||||
Reference in New Issue
Block a user