diff options
| author | Samuel Tardieu <sam@rfc1149.net> | 2024-10-06 18:33:39 +0200 |
|---|---|---|
| committer | Samuel Tardieu <sam@rfc1149.net> | 2024-10-06 18:52:24 +0200 |
| commit | af6816c5b6a4b2cca1308d52c40543bb845b9d44 (patch) | |
| tree | 0f9ceb440c690fa3ed8ddf557209515ead3bbfda /tests/coverage/branch/lazy-boolean.coverage | |
| parent | 753629bb33c9fff9fb693a2d1d4464bd696ccf62 (diff) | |
| download | rust-af6816c5b6a4b2cca1308d52c40543bb845b9d44.tar.gz rust-af6816c5b6a4b2cca1308d52c40543bb845b9d44.zip | |
`infinite_loop`: do not defensively use `saturating_sub()`
Using `saturating_sub()` here in code which cannot fail brings a false sense of security. If for any reason a logic error was introduced and caused `self.loop_depth` to reach 0 before being decremented, using `saturating_sub(1)` would silently mask the programming error instead of panicking loudly as it should (at least in dev profile).
Diffstat (limited to 'tests/coverage/branch/lazy-boolean.coverage')
0 files changed, 0 insertions, 0 deletions
