Skip to content

Commit e7d4614

Browse files
committed
Improve documentation
1 parent 0790bfd commit e7d4614

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Python-esque for-else construct for Rust
77

88
## Overview
99

10-
The for-else library introduces a procedural macro, for_!, that extends the capabilities of the standard for loop in Rust.
11-
This enhancement allows for an else block to be added directly within the loop,
12-
which is executed only if the loop completes without hitting a break statement, closely mirroring Python's for-else construct.
10+
The for-else library introduces two procedural macros, `for_!` and `while_!`, that extend the capabilities of the standard loops in Rust.
11+
This enhancement allows for an else block to be added directly after the loop,
12+
which is executed only if the loop completes without hitting a break statement, closely mirroring Python's for-else and while-else constructs.
1313

1414
## Usage
1515

src/lib.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,7 @@ fn modify_single_break(
351351
/// ```
352352
///
353353
/// ## Nested loops with labels
354+
/// Labels should be put inside the macro
354355
///
355356
/// ```rust
356357
/// use for_else::for_;
@@ -530,6 +531,9 @@ impl Parse for WhileLoop {
530531
/// // loop body
531532
/// } else {
532533
/// // else block
534+
/// }}
535+
/// ```
536+
///
533537
/// # Notes
534538
///
535539
/// - The macro supports all the same conditions as standard `while` loops
@@ -619,6 +623,7 @@ impl Parse for WhileLoop {
619623
/// ```
620624
///
621625
/// ## Nested loops with labels
626+
/// Labels should be put inside the macro
622627
///
623628
/// ```rust
624629
/// use for_else::while_;

0 commit comments

Comments
 (0)