File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2352,25 +2352,27 @@ impl FundingScope {
23522352}
23532353
23542354// TODO: Remove once MSRV is at least 1.66
2355+ #[cfg(splicing)]
23552356trait AddSigned {
23562357 fn checked_add_signed(self, rhs: i64) -> Option<u64>;
23572358 fn saturating_add_signed(self, rhs: i64) -> u64;
23582359}
23592360
2361+ #[cfg(splicing)]
23602362impl AddSigned for u64 {
23612363 fn checked_add_signed(self, rhs: i64) -> Option<u64> {
23622364 if rhs >= 0 {
23632365 self.checked_add(rhs as u64)
23642366 } else {
2365- self.checked_sub(rhs.abs() as u64 )
2367+ self.checked_sub(rhs.unsigned_abs() )
23662368 }
23672369 }
23682370
23692371 fn saturating_add_signed(self, rhs: i64) -> u64 {
23702372 if rhs >= 0 {
23712373 self.saturating_add(rhs as u64)
23722374 } else {
2373- self.saturating_sub(rhs.abs() as u64 )
2375+ self.saturating_sub(rhs.unsigned_abs() )
23742376 }
23752377 }
23762378}
You can’t perform that action at this time.
0 commit comments