Comments

This lesson will teach you how to comment your code in Rust.

Comments are programmer readable instructions to help explain things about your code. The compiler ignores them.

Types of Comments in Rust

Rust has two types of comments that are commonly used:

Line Comments //

The comments followed by a double forward slash, //, are known as line comments.

This is the most recommended style of comment for commenting a single line.

Create a free account to access the full course.

Continue your learning journey with a 14-day free trial.

By signing up, you agree to Educative's Terms of Service and Privacy Policy