Simplify assert_bits
impl
This commit is contained in:
parent
dad0036cb4
commit
98b70c9ac0
1 changed files with 3 additions and 4 deletions
|
@ -225,10 +225,9 @@ impl ScalarInt {
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn assert_bits(self, target_size: Size) -> u128 {
|
pub fn assert_bits(self, target_size: Size) -> u128 {
|
||||||
assert_ne!(target_size.bytes(), 0, "you should never look at the bits of a ZST");
|
self.to_bits(target_size).unwrap_or_else(|size| {
|
||||||
assert_eq!(target_size.bytes(), u64::from(self.size));
|
bug!("int of size {}, but is {}", target_size.bytes(), size.bytes())
|
||||||
self.check_data();
|
})
|
||||||
self.data
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[inline]
|
#[inline]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue