Skip to content

Commit

Permalink
Update doc_testing.md (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
fake-rick committed Feb 1, 2024
1 parent 977483e commit ae2cd03
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/testing/doc_testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
/// # fn main() { // 开始主函数,其中将展开 `try_main` 函数
/// # try_main().unwrap(); // 调用并展开 try_main,这样出错时测试会 panic
/// # }
/// ```
pub fn try_div(a: i32, b: i32) -> Result<i32, String> {
if b == 0 {
Err(String::from("Divide-by-zero"))
Expand Down

0 comments on commit ae2cd03

Please sign in to comment.