Skip to content

Commit

Permalink
forgot to add intermediate.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
rooooooooob committed Feb 27, 2024
1 parent 13f0ffd commit 9f02b81
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions src/intermediate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -837,22 +837,26 @@ pub enum Primitive {

impl std::fmt::Display for Primitive {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", match self {
Primitive::Bool => "bool",
Primitive::F32 => "f32",
Primitive::F64 => "f64",
Primitive::U8 => "u8",
Primitive::I8 => "i8",
Primitive::U16 => "u16",
Primitive::I16 => "i16",
Primitive::U32 => "u32",
Primitive::I32 => "i32",
Primitive::U64 => "u64",
Primitive::I64 => "i64",
Primitive::N64 => "u64",
Primitive::Str => "String",
Primitive::Bytes => "Vec<u8>",
})
write!(
f,
"{}",
match self {
Primitive::Bool => "bool",
Primitive::F32 => "f32",
Primitive::F64 => "f64",
Primitive::U8 => "u8",
Primitive::I8 => "i8",
Primitive::U16 => "u16",
Primitive::I16 => "i16",
Primitive::U32 => "u32",
Primitive::I32 => "i32",
Primitive::U64 => "u64",
Primitive::I64 => "i64",
Primitive::N64 => "u64",
Primitive::Str => "String",
Primitive::Bytes => "Vec<u8>",
}
)
}
}
// TODO: impl display or fmt or whatever rust uses
Expand Down

0 comments on commit 9f02b81

Please sign in to comment.