mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
simplify and fully implement comparisons
This commit is contained in:
parent
cefc1c775e
commit
af2ab24525
5 changed files with 125 additions and 266 deletions
|
@ -433,6 +433,22 @@ impl<'a> InLayout<'a> {
|
|||
pub fn index(&self) -> usize {
|
||||
self.0
|
||||
}
|
||||
|
||||
pub fn try_int_width(self) -> Option<IntWidth> {
|
||||
match self {
|
||||
Layout::U8 => Some(IntWidth::U8),
|
||||
Layout::U16 => Some(IntWidth::U16),
|
||||
Layout::U32 => Some(IntWidth::U32),
|
||||
Layout::U64 => Some(IntWidth::U64),
|
||||
Layout::U128 => Some(IntWidth::U128),
|
||||
Layout::I8 => Some(IntWidth::I8),
|
||||
Layout::I16 => Some(IntWidth::I16),
|
||||
Layout::I32 => Some(IntWidth::I32),
|
||||
Layout::I64 => Some(IntWidth::I64),
|
||||
Layout::I128 => Some(IntWidth::I128),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// A concurrent interner, suitable for usage between threads.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue