From 7797bf8461f1dd1fc03e56ef8e03a3654ae0aa99 Mon Sep 17 00:00:00 2001 From: kevaundray Date: Sun, 29 Oct 2023 20:57:43 +0000 Subject: [PATCH] cargo fmt --- acvm-repo/acir/src/circuit/mod.rs | 11 ++++------- compiler/noirc_driver/src/contract.rs | 5 ++++- compiler/noirc_driver/src/program.rs | 7 +++++-- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/acvm-repo/acir/src/circuit/mod.rs b/acvm-repo/acir/src/circuit/mod.rs index 6480177447c..79199e71d87 100644 --- a/acvm-repo/acir/src/circuit/mod.rs +++ b/acvm-repo/acir/src/circuit/mod.rs @@ -9,12 +9,9 @@ use thiserror::Error; use std::{io::prelude::*, num::ParseIntError, str::FromStr}; -use flate2::Compression; use base64::Engine; -use serde::{ - Deserialize, Deserializer, Serialize, Serializer, - de::Error as DeserializationError -}; +use flate2::Compression; +use serde::{de::Error as DeserializationError, Deserialize, Deserializer, Serialize, Serializer}; use std::collections::BTreeSet; @@ -158,13 +155,13 @@ impl Circuit { // Serialize and base64 encode circuit pub fn serialize_circuit_base64(circuit: &Circuit, s: S) -> Result where - S: Serializer, + S: Serializer, { let circuit_bytes = Circuit::serialize_circuit(circuit); let encoded_b64 = base64::engine::general_purpose::STANDARD.encode(circuit_bytes); s.serialize_str(&encoded_b64) } - + // Deserialize and base64 decode circuit pub fn deserialize_circuit_base64<'de, D>(deserializer: D) -> Result where diff --git a/compiler/noirc_driver/src/contract.rs b/compiler/noirc_driver/src/contract.rs index 49c0c72c67b..ae55d239cf3 100644 --- a/compiler/noirc_driver/src/contract.rs +++ b/compiler/noirc_driver/src/contract.rs @@ -61,7 +61,10 @@ pub struct ContractFunction { pub abi: Abi, - #[serde(serialize_with = "Circuit::serialize_circuit_base64", deserialize_with = "Circuit::deserialize_circuit_base64")] + #[serde( + serialize_with = "Circuit::serialize_circuit_base64", + deserialize_with = "Circuit::deserialize_circuit_base64" + )] pub bytecode: Circuit, pub debug: DebugInfo, diff --git a/compiler/noirc_driver/src/program.rs b/compiler/noirc_driver/src/program.rs index 7620581aeae..8d509d3bf68 100644 --- a/compiler/noirc_driver/src/program.rs +++ b/compiler/noirc_driver/src/program.rs @@ -18,10 +18,13 @@ pub struct CompiledProgram { /// Used to short-circuit compilation in the case of the source code not changing since the last compilation. pub hash: u64, - #[serde(serialize_with = "Circuit::serialize_circuit_base64", deserialize_with = "Circuit::deserialize_circuit_base64")] + #[serde( + serialize_with = "Circuit::serialize_circuit_base64", + deserialize_with = "Circuit::deserialize_circuit_base64" + )] pub circuit: Circuit, pub abi: noirc_abi::Abi, pub debug: DebugInfo, pub file_map: BTreeMap, pub warnings: Vec, -} \ No newline at end of file +}