Rust TutorialLesson 6Free preview
Rust Comments
This lesson is part of Rust · All levels
Summary
This lesson explains how to write comments in Rust program code. Commentary serves to explain the documentation and will be ignored by the compiler when building the program. Rust supports single-line commentary, multi-line commentary, as well as special documentation commentary.
Key points
- One line commentary begins with a double slash '//'
- Comments are lined up between '/*' and '*/'
- Documentation commentary is started with '///' to generate HTML documentation
- Clean comment writing makes it easier for teams to maintain code
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.