mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 21:39:07 +00:00
Use [u8; 16] to avoid number alignment bumps
This commit is contained in:
parent
0d51443575
commit
49aea9d639
20 changed files with 154 additions and 109 deletions
|
@ -50,15 +50,15 @@ impl Output {
|
|||
|
||||
#[derive(Clone, Debug, PartialEq)]
|
||||
pub enum IntValue {
|
||||
I128(i128),
|
||||
U128(u128),
|
||||
I128([u8; 16]),
|
||||
U128([u8; 16]),
|
||||
}
|
||||
|
||||
impl Display for IntValue {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self {
|
||||
IntValue::I128(n) => Display::fmt(&n, f),
|
||||
IntValue::U128(n) => Display::fmt(&n, f),
|
||||
IntValue::I128(n) => Display::fmt(&i128::from_ne_bytes(*n), f),
|
||||
IntValue::U128(n) => Display::fmt(&u128::from_ne_bytes(*n), f),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue