mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-10 05:53:10 +00:00
Simplify assert_bits
impl
This commit is contained in:
parent
dad0036cb4
commit
98b70c9ac0
@ -225,10 +225,9 @@ impl ScalarInt {
|
||||
|
||||
#[inline]
|
||||
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");
|
||||
assert_eq!(target_size.bytes(), u64::from(self.size));
|
||||
self.check_data();
|
||||
self.data
|
||||
self.to_bits(target_size).unwrap_or_else(|size| {
|
||||
bug!("int of size {}, but is {}", target_size.bytes(), size.bytes())
|
||||
})
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
Loading…
Reference in New Issue
Block a user