注释
行注释
// 创建一个绑定
let x = 5;
let y = 6; // 创建另一个绑定文档注释
/// Adds one to the number given.
///
/// # Examples
///
/// ```
/// let five = 5;
///
/// assert_eq!(6, add_one(5));
/// # fn add_one(x: i32) -> i32 {
/// # x + 1
/// # }
/// ```
fn add_one(x: i32) -> i32 {
x + 1
}模块注释
其它:兼容C语言的注释
Last updated