Skip to content

Commit

Permalink
User &Program
Browse files Browse the repository at this point in the history
  • Loading branch information
pefontana committed Oct 11, 2023
1 parent d78f9f7 commit 39a8079
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vm/src/serde/deserialize_program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ pub fn parse_program_json(
})
}

impl From<Program> for ProgramJson {
fn from(program: Program) -> Self {
impl From<&Program> for ProgramJson {
fn from(program: &Program) -> Self {
let references = program
.shared_program_data
.reference_manager
Expand All @@ -547,7 +547,7 @@ impl From<Program> for ProgramJson {

Self {
prime: program.prime().into(),
builtins: program.builtins,
builtins: program.builtins.clone(),
data: program.shared_program_data.data.clone(),
identifiers: program.shared_program_data.identifiers.clone(),
// hints: program.shared_program_data.hints.clone(),
Expand Down Expand Up @@ -1713,7 +1713,7 @@ mod tests {
for bytes in programs_bytes {
let original_program = Program::from_bytes(&bytes, Some("main")).unwrap();

let program_json = ProgramJson::from(original_program.clone());
let program_json = ProgramJson::from(&original_program);

let new_program = parse_program_json(program_json, Some("main")).unwrap();

Expand Down

0 comments on commit 39a8079

Please sign in to comment.