-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use saturating_sub instead of - for unsigned ints #1530
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #1530 +/- ##
=======================================
Coverage 68.74% 68.75%
=======================================
Files 120 120
Lines 13094 13094
=======================================
+ Hits 9002 9003 +1
+ Misses 4092 4091 -1 |
Hey @rumpl , the formatting check is failing in the CI. Can you run cargo fmt, and push again. Also if possible, can you amend the current commit instead of adding a new one for formatting. I am also curious if we should do a similar saturating operation for other additions or subtractions related to such cgroups values. What do you think? |
Hey, I created a new PR that only fixes formatting, the failures are unrelated to the changes I made here, the PR: #1532 |
Ok nevermind, I found other places where there was unsigned subtrations, fixed them |
9af9b16
to
e92e7e3
Compare
@rumpl May I ask you to rebase from the latest main branch? |
This fixes a panic if the operation with the unsigned ints would result in a negative number Signed-off-by: Djordje Lukic <[email protected]>
e92e7e3
to
e01e604
Compare
@utam0k done 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm 👍
Thanks a lot! |
This fixes a panic if the operation with the unsigned ints would result in a negative number