forked from clap-rs/clap-verbosity-flag
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use u8 for internal verbosity level calculation
This avoids integer overflow / underflow errors when calculating the verbosity level. Prior to this change, constructing a `Verbosity` with either parameter equal to `u8::MAX` would result in incorrect verbosity level calculation. This change adds tests to ensure that the verbosity level is correctly calculated for each log level. These were run before and after the change to ensure that the change is correct. The tests using 255 as either input value were failing before the change and passing after the change.
- Loading branch information
Showing
1 changed file
with
177 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters