PDF版 ePub版

# 注释

Rust 中有两种你应该学习的注释方式：行注释和文档注释。

// Line comments are anything after ‘//’ and extend to the end of the line.

let x = 5; // this is also a line comment.

// If you have a long explanation for something, you can put line comments next
// to each other. Put a space between the // and your comment so that it’s
// more readable.

/// Adds one to the number given.
///
/// # Examples
///
/// 
/// let five = 5;
///
/// 
}