Organize imports (#188)

* Organize imports

Use rustfmt to organize imports.  Resolve #162

* remove unused imports

* cargo fmt
This commit is contained in:
Eduard S. 2025-04-07 16:19:13 -07:00 committed by GitHub
parent 1214cdfa1b
commit 24ff82dd3d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
32 changed files with 329 additions and 276 deletions

View file

@ -1,14 +1,15 @@
use std::collections::HashMap;
/// This file implements the types defined at
/// https://0xparc.github.io/pod2/values.html#dictionary-array-set .
use anyhow::Result;
use std::collections::HashMap;
use crate::constants::MAX_DEPTH;
#[cfg(feature = "backend_plonky2")]
use crate::backends::plonky2::primitives::merkletree::{Iter as TreeIter, MerkleProof, MerkleTree};
use super::basetypes::{hash_value, Hash, Value, EMPTY_VALUE};
use crate::{
constants::MAX_DEPTH,
middleware::basetypes::{hash_value, Hash, Value, EMPTY_VALUE},
};
/// Dictionary: the user original keys and values are hashed to be used in the leaf.
/// leaf.key=hash(original_key)

View file

@ -1,18 +1,18 @@
use std::collections::HashMap;
use std::sync::Arc;
use std::{fmt, hash as h, iter, iter::zip};
use std::{collections::HashMap, fmt, hash as h, iter, iter::zip, sync::Arc};
use anyhow::{anyhow, Result};
use plonky2::field::types::Field;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use super::{
hash_fields, AnchoredKey, Hash, NativePredicate, Params, PodId, Statement, StatementArg,
ToFields, Value, F,
use crate::{
backends::plonky2::basetypes::HASH_SIZE,
middleware::{
hash_fields, AnchoredKey, Hash, NativePredicate, Params, PodId, Statement, StatementArg,
ToFields, Value, F,
},
util::hashmap_insert_no_dupe,
};
use crate::backends::plonky2::basetypes::HASH_SIZE;
use crate::util::hashmap_insert_no_dupe;
// BEGIN Custom 1b

View file

@ -7,20 +7,16 @@ mod custom;
mod operation;
pub mod serialization;
mod statement;
pub use basetypes::*;
pub use custom::*;
pub use operation::*;
use schemars::JsonSchema;
pub use statement::*;
use std::{any::Any, collections::HashMap, fmt};
use anyhow::Result;
pub use basetypes::*;
pub use custom::*;
use dyn_clone::DynClone;
pub use operation::*;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::any::Any;
use std::collections::HashMap;
use std::fmt;
use crate::backends::plonky2::primitives::merkletree::MerkleProof;
pub use statement::*;
pub const SELF: PodId = PodId(SELF_ID_HASH);

View file

@ -1,17 +1,16 @@
use std::{fmt, iter};
use anyhow::{anyhow, Result};
use log::error;
use plonky2::field::types::Field;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::iter;
use super::Hash;
use super::{CustomPredicateRef, NativePredicate, Statement, StatementArg, ToFields, F};
use crate::middleware::EMPTY_HASH;
use crate::middleware::EMPTY_VALUE;
use crate::{
backends::plonky2::primitives::merkletree::{MerkleProof, MerkleTree},
middleware::{AnchoredKey, Params, Predicate, Value, SELF},
middleware::{
AnchoredKey, CustomPredicateRef, NativePredicate, Params, Predicate, Statement,
StatementArg, ToFields, Value, F, SELF,
},
};
#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]

View file

@ -1,7 +1,7 @@
use plonky2::field::types::Field;
use serde::Deserialize;
use super::{F, HASH_SIZE, VALUE_SIZE};
use crate::middleware::{F, HASH_SIZE, VALUE_SIZE};
fn serialize_field_tuple<S, const N: usize>(
value: &[F; N],

View file

@ -1,11 +1,14 @@
use std::{fmt, iter};
use anyhow::{anyhow, Result};
use plonky2::field::types::Field;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use std::{fmt, iter};
use strum_macros::FromRepr;
use super::{AnchoredKey, CustomPredicateRef, Params, Predicate, ToFields, Value, F, VALUE_SIZE};
use crate::middleware::{
AnchoredKey, CustomPredicateRef, Params, Predicate, ToFields, Value, F, VALUE_SIZE,
};
// hash(KEY_SIGNER) = [2145458785152392366, 15113074911296146791, 15323228995597834291, 11804480340100333725]
pub const KEY_SIGNER: &str = "_signer";