Skip to content

Commit

Permalink
refactor: remove generic_id from serialized output
Browse files Browse the repository at this point in the history
  • Loading branch information
zmalatrax committed Oct 25, 2024
1 parent 402c62c commit 87b3063
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions crates/cairo-lang-sierra-to-casm/src/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,13 @@ pub struct CasmCairoEntryPoint {

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct CasmCairoArg {
pub generic_id: GenericTypeId,
pub size: i16,
#[serde(skip_serializing_if = "skip_if_none")]
pub debug_name: Option<String>,
}

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct CasmCairoOutputArg {
pub generic_id: GenericTypeId,
pub size: i16,
#[serde(skip_serializing_if = "skip_if_none")]
pub debug_name: Option<String>,
Expand Down Expand Up @@ -241,7 +239,7 @@ impl CasmCairoProgram {
Either::Left(generic_id.0.as_str().to_case(Case::Snake))
} else {
let size = *type_sizes.get(type_id).unwrap();
Either::Right(CasmCairoArg { generic_id, size, debug_name })
Either::Right(CasmCairoArg { size, debug_name })
}
});

Expand Down Expand Up @@ -270,10 +268,8 @@ impl CasmCairoProgram {
GenericArg::Type(ty) => {
let debug_name =
ty.debug_name.clone().map(|name| name.to_string());
let generic_id =
type_resolver.get_generic_id(ty).clone();
let size = *type_sizes.get(ty).unwrap();
Some(CasmCairoArg { generic_id, size, debug_name })
Some(CasmCairoArg { size, debug_name })
}
_ => None,
}),
Expand All @@ -283,7 +279,7 @@ impl CasmCairoProgram {
None
};

CasmCairoOutputArg { generic_id, size, panic_inner_type, debug_name }
CasmCairoOutputArg { size, panic_inner_type, debug_name }
})
.into_iter()
.collect_vec();
Expand Down

0 comments on commit 87b3063

Please sign in to comment.