mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 13:31:10 +00:00
fix perthing add (#9638)
This commit is contained in:
committed by
GitHub
parent
a636b7a512
commit
10268c5b76
@@ -772,10 +772,12 @@ macro_rules! implement_per_thing {
|
||||
impl Add<Self> for $name {
|
||||
type Output = $name;
|
||||
|
||||
// For PerU16, $max == u16::MAX, so we need this `allow`.
|
||||
#[allow(unused_comparisons)]
|
||||
#[inline]
|
||||
fn add(self, rhs: Self) -> Self::Output {
|
||||
let inner = self.deconstruct().add(rhs.deconstruct());
|
||||
debug_assert!(inner < $max);
|
||||
debug_assert!(inner <= $max);
|
||||
$name::from_parts(inner)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user