mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-02-24 13:22:19 +08:00
14 lines
206 B
Rust
Executable File
14 lines
206 B
Rust
Executable File
/// Adds one to the number given.
|
|
///
|
|
/// # Examples
|
|
///
|
|
/// ```
|
|
/// let arg = 5;
|
|
/// let answer = my_crate::add_one(arg);
|
|
///
|
|
/// assert_eq!(6, answer);
|
|
/// ```
|
|
pub fn add_one(x: i32) -> i32 {
|
|
x + 1
|
|
}
|