/// 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
}
代码14-1 一个函数的文档(document comment)
可以运行 cargo doc
来生产文档注释的html文件,用 cargo doc --open
来查看文档