mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 04:29:41 +00:00
fix typos
This commit is contained in:
@ -183,7 +183,7 @@ Add following code to `src/compute.rs` ,
|
|||||||
|
|
||||||
/// ```
|
/// ```
|
||||||
/// # fn try_main() -> Result<(), String> {
|
/// # fn try_main() -> Result<(), String> {
|
||||||
/// let res = doc_comments::compute::try_div(10, 0)?;
|
/// # let res = doc_comments::compute::try_div(10, 0)?;
|
||||||
/// # Ok(()) // returning from try_main
|
/// # Ok(()) // returning from try_main
|
||||||
/// # }
|
/// # }
|
||||||
/// # fn main() {
|
/// # fn main() {
|
||||||
@ -228,7 +228,7 @@ Add following code to `src/lib.rs`:
|
|||||||
```rust
|
```rust
|
||||||
// in lib.rs
|
// in lib.rs
|
||||||
|
|
||||||
/// Add one to the given value and return a [`Option`] type
|
/// Add three to the given value and return a [`Option`] type
|
||||||
pub fn add_three(x: i32) -> Option<i32> {
|
pub fn add_three(x: i32) -> Option<i32> {
|
||||||
Some(x + 3)
|
Some(x + 3)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user