Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelburnham committed Oct 18, 2023
1 parent d312f3f commit c70213b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/cli/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use serde::Deserialize;

use crate::field::LanguageField;

#[derive(Clone, Default, Debug, Deserialize, ValueEnum, PartialEq)]
#[derive(Clone, Default, Debug, Deserialize, ValueEnum, PartialEq, Eq)]
pub enum Backend {
#[default]
Nova,
Expand Down
5 changes: 2 additions & 3 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ pub fn home_dir() -> Utf8PathBuf {
.expect("path contains invalid Unicode")
}

#[derive(Default, Debug, PartialEq)]
#[derive(Default, Debug, PartialEq, Eq)]
pub enum Flow {
#[default]
Sequential,
Expand Down Expand Up @@ -124,7 +124,7 @@ pub struct ParallelConfig {
}

/// Should we use optimized witness-generation when possible?
#[derive(Debug, Default, PartialEq)]
#[derive(Debug, Default, PartialEq, Eq)]
pub struct WitnessGeneration {
// NOTE: Neptune itself *will* do this transparently at the level of individual hashes, where possible.
// so this configuration is only required for higher-level decisions.
Expand Down Expand Up @@ -327,7 +327,6 @@ mod tests {
let public_params_dir_dup = tmp_dir.join("public_params_dup").into_string();

let mut config_file = File::create(config_dir.clone()).unwrap();
// The second entry should take priority
config_file
.write_all(format!("public_params_dir = \"{public_params_dir}\"\n").as_bytes())
.unwrap();
Expand Down
8 changes: 5 additions & 3 deletions src/public_parameters/mem_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@ use crate::proof::MultiFrameTrait;
use crate::{
coprocessor::Coprocessor,
proof::nova::{PublicParams, G1, G2},
public_parameters::disk_cache::public_params_dir,
};
use crate::{proof::nova::CurveCycleEquipped, public_parameters::error::Error};

use super::{disk_cache::DiskCache, instance::Instance};
use super::{
disk_cache::{public_params_dir, DiskCache},
instance::Instance,
};

type AnyMap = anymap::Map<dyn core::any::Any + Send + Sync>;
type PublicParamMap<F, M> = HashMap<(usize, bool), Arc<PublicParams<F, M>>>;
Expand Down Expand Up @@ -53,7 +55,7 @@ impl PublicParamMemCache {
<<G2<F> as Group>::Scalar as ff::PrimeField>::Repr: Abomonation,
{
// subdirectory search
let disk_cache = DiskCache::new(&public_params_dir()).unwrap();
let disk_cache = DiskCache::new(public_params_dir()).unwrap();

// read the file if it exists, otherwise initialize
if instance.abomonated {
Expand Down
8 changes: 4 additions & 4 deletions src/public_parameters/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ where
{
let default =
|instance: &Instance<'a, F, C, M>| nova::public_params(instance.rc, instance.lang());
let disk_cache = DiskCache::<F, C, M>::new(&public_params_dir()).unwrap();
let disk_cache = DiskCache::<F, C, M>::new(public_params_dir()).unwrap();

let mut bytes = vec![];
let pp = disk_cache.read_bytes(instance, &mut bytes).and_then(|()| {
Expand Down Expand Up @@ -95,7 +95,7 @@ where
<<G1<F> as Group>::Scalar as ff::PrimeField>::Repr: Abomonation,
<<G2<F> as Group>::Scalar as ff::PrimeField>::Repr: Abomonation,
{
let disk_cache = DiskCache::<F, C, M>::new(&public_params_dir()).unwrap();
let disk_cache = DiskCache::<F, C, M>::new(public_params_dir()).unwrap();

let mut bytes = vec![];
disk_cache.read_bytes(instance, &mut bytes).and_then(|()| {
Expand Down Expand Up @@ -123,7 +123,7 @@ where
<<G1<F> as Group>::Scalar as ff::PrimeField>::Repr: Abomonation,
<<G2<F> as Group>::Scalar as ff::PrimeField>::Repr: Abomonation,
{
let disk_cache = DiskCache::<F, C, M>::new(&public_params_dir()).unwrap();
let disk_cache = DiskCache::<F, C, M>::new(public_params_dir()).unwrap();

let mut bytes = vec![];
disk_cache.read_bytes(instance, &mut bytes).and_then(|()| {
Expand Down Expand Up @@ -159,7 +159,7 @@ where
let default = |instance: &Instance<'a, F, C, M>| {
supernova::public_params::<'a, F, C, M>(instance.rc, instance.lang())
};
let disk_cache = DiskCache::<F, C, M>::new(&public_params_dir()).unwrap();
let disk_cache = DiskCache::<F, C, M>::new(public_params_dir()).unwrap();

let maybe_circuit_params_vec = instance_primary
.circuit_param_instances()
Expand Down

0 comments on commit c70213b

Please sign in to comment.