Skip to content

Commit

Permalink
fix comment in function parameter drop scope example
Browse files Browse the repository at this point in the history
In "Scopes of function parameters" under "Destructors", the first
comment in the example that demonstrates function parameter
drop order contradicted both the text and the program behavior.
  • Loading branch information
tlyu committed Jul 5, 2021
1 parent 8337ad1 commit ed5ba7c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/destructors.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ dropped after any bindings introduced in that parameter's pattern.
# println!("drop({})", self.0);
# }
# }
// Drops the second parameter, then `y`, then the first parameter, then `x`
// Drops `y`, then the second parameter, then `x`, then the first parameter
fn patterns_in_parameters(
(x, _): (PrintOnDrop, PrintOnDrop),
(_, y): (PrintOnDrop, PrintOnDrop),
Expand Down

0 comments on commit ed5ba7c

Please sign in to comment.