Skip to content

Commit dfce4ad

Browse files
authored
Merge pull request #1919 from KennedyRichard/patch-1
Add example to comment.md to teach how to toggle a whole code block using block comments
2 parents 4e4a37e + 46a68fe commit dfce4ad

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/hello/comment.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ fn main() {
3434
no actual need for it.
3535
*/
3636
37+
// Here's another powerful use of block comments: you can uncomment
38+
// and comment a whole block by simply adding or removing a single
39+
// '/' character:
40+
41+
/* <- add another '/' before the 1st one to uncomment the whole block
42+
43+
println!("Now");
44+
println!("everything");
45+
println!("executes!");
46+
// line comments inside are not affected by either state
47+
48+
// */
49+
3750
// You can manipulate expressions more easily with block comments
3851
// than with line comments. Try deleting the comment delimiters
3952
// to change the result:

0 commit comments

Comments
 (0)