From 9b55ff9e816ede79a3630a84086feee5a5e5990a Mon Sep 17 00:00:00 2001 From: Daniel Lubarov Date: Wed, 17 Nov 2021 14:43:54 -0800 Subject: [PATCH] edition = 2021 (#370) * edition = 2021 Doesn't affect anything for us as far as I've noticed. * imports --- Cargo.toml | 2 +- src/field/extension_field/mod.rs | 2 -- src/field/extension_field/target.rs | 1 - src/field/field_types.rs | 1 - src/field/secp256k1.rs | 1 - src/gadgets/arithmetic_extension.rs | 4 ---- src/gadgets/hash.rs | 2 -- src/gates/gmimc.rs | 2 -- src/gates/insertion.rs | 1 - src/gates/interpolation.rs | 1 - src/gates/poseidon.rs | 3 --- src/gates/poseidon_mds.rs | 1 - src/hash/arch/aarch64/poseidon_goldilocks_neon.rs | 1 - src/hash/arch/x86_64/poseidon_goldilocks_avx2_bmi2.rs | 1 - src/hash/hash_types.rs | 2 -- src/hash/hashing.rs | 2 -- src/hash/merkle_proofs.rs | 2 -- src/hash/poseidon.rs | 2 -- src/iop/challenger.rs | 2 -- src/iop/witness.rs | 1 - src/plonk/circuit_builder.rs | 1 - src/plonk/vars.rs | 1 - src/util/serialization.rs | 2 -- 23 files changed, 1 insertion(+), 37 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4c182fa2..d3f46e35 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" repository = "https://github.com/mir-protocol/plonky2" keywords = ["cryptography", "SNARK", "FRI"] categories = ["cryptography"] -edition = "2018" +edition = "2021" default-run = "bench_recursion" [dependencies] diff --git a/src/field/extension_field/mod.rs b/src/field/extension_field/mod.rs index 08443386..611c5671 100644 --- a/src/field/extension_field/mod.rs +++ b/src/field/extension_field/mod.rs @@ -1,5 +1,3 @@ -use std::convert::TryInto; - use crate::field::field_types::{Field, PrimeField}; pub mod algebra; diff --git a/src/field/extension_field/target.rs b/src/field/extension_field/target.rs index ab3c3619..3f9b6684 100644 --- a/src/field/extension_field/target.rs +++ b/src/field/extension_field/target.rs @@ -1,4 +1,3 @@ -use std::convert::{TryFrom, TryInto}; use std::ops::Range; use crate::field::extension_field::algebra::ExtensionAlgebra; diff --git a/src/field/field_types.rs b/src/field/field_types.rs index aed654d5..bbb1604e 100644 --- a/src/field/field_types.rs +++ b/src/field/field_types.rs @@ -1,4 +1,3 @@ -use std::convert::TryInto; use std::fmt::{Debug, Display}; use std::hash::Hash; use std::iter::{Product, Sum}; diff --git a/src/field/secp256k1.rs b/src/field/secp256k1.rs index 5f8e1b4e..75221a1f 100644 --- a/src/field/secp256k1.rs +++ b/src/field/secp256k1.rs @@ -1,4 +1,3 @@ -use std::convert::TryInto; use std::fmt; use std::fmt::{Debug, Display, Formatter}; use std::hash::{Hash, Hasher}; diff --git a/src/gadgets/arithmetic_extension.rs b/src/gadgets/arithmetic_extension.rs index 5716ddc3..7b6535f9 100644 --- a/src/gadgets/arithmetic_extension.rs +++ b/src/gadgets/arithmetic_extension.rs @@ -1,5 +1,3 @@ -use std::convert::TryInto; - use crate::field::extension_field::target::{ExtensionAlgebraTarget, ExtensionTarget}; use crate::field::extension_field::FieldExtension; use crate::field::extension_field::{Extendable, OEF}; @@ -531,8 +529,6 @@ pub(crate) struct ExtensionArithmeticOperation, co #[cfg(test)] mod tests { - use std::convert::TryInto; - use anyhow::Result; use crate::field::extension_field::algebra::ExtensionAlgebra; diff --git a/src/gadgets/hash.rs b/src/gadgets/hash.rs index db4cb1e8..2eb93da7 100644 --- a/src/gadgets/hash.rs +++ b/src/gadgets/hash.rs @@ -1,5 +1,3 @@ -use std::convert::TryInto; - use crate::field::extension_field::Extendable; use crate::field::field_types::RichField; use crate::gates::gmimc::GMiMCGate; diff --git a/src/gates/gmimc.rs b/src/gates/gmimc.rs index 8a12df54..1947c851 100644 --- a/src/gates/gmimc.rs +++ b/src/gates/gmimc.rs @@ -328,8 +328,6 @@ impl + GMiMC, const D: usize, const WIDTH: u #[cfg(test)] mod tests { - use std::convert::TryInto; - use anyhow::Result; use crate::field::field_types::Field; diff --git a/src/gates/insertion.rs b/src/gates/insertion.rs index dcc79f05..c55f53a9 100644 --- a/src/gates/insertion.rs +++ b/src/gates/insertion.rs @@ -1,4 +1,3 @@ -use std::convert::TryInto; use std::marker::PhantomData; use std::ops::Range; diff --git a/src/gates/interpolation.rs b/src/gates/interpolation.rs index 52dca440..d97eb009 100644 --- a/src/gates/interpolation.rs +++ b/src/gates/interpolation.rs @@ -1,4 +1,3 @@ -use std::convert::TryInto; use std::marker::PhantomData; use std::ops::Range; diff --git a/src/gates/poseidon.rs b/src/gates/poseidon.rs index ccec2445..ef212a2b 100644 --- a/src/gates/poseidon.rs +++ b/src/gates/poseidon.rs @@ -1,4 +1,3 @@ -use std::convert::TryInto; use std::marker::PhantomData; use crate::field::extension_field::target::ExtensionTarget; @@ -538,8 +537,6 @@ where #[cfg(test)] mod tests { - use std::convert::TryInto; - use anyhow::Result; use crate::field::field_types::Field; diff --git a/src/gates/poseidon_mds.rs b/src/gates/poseidon_mds.rs index a127df68..1abbe71f 100644 --- a/src/gates/poseidon_mds.rs +++ b/src/gates/poseidon_mds.rs @@ -1,4 +1,3 @@ -use std::convert::TryInto; use std::marker::PhantomData; use std::ops::Range; diff --git a/src/hash/arch/aarch64/poseidon_goldilocks_neon.rs b/src/hash/arch/aarch64/poseidon_goldilocks_neon.rs index f122e0ef..5d9d9fba 100644 --- a/src/hash/arch/aarch64/poseidon_goldilocks_neon.rs +++ b/src/hash/arch/aarch64/poseidon_goldilocks_neon.rs @@ -1,5 +1,4 @@ use std::arch::aarch64::*; -use std::convert::TryInto; use static_assertions::const_assert; use unroll::unroll_for_loops; diff --git a/src/hash/arch/x86_64/poseidon_goldilocks_avx2_bmi2.rs b/src/hash/arch/x86_64/poseidon_goldilocks_avx2_bmi2.rs index 1df21550..5497ab6c 100644 --- a/src/hash/arch/x86_64/poseidon_goldilocks_avx2_bmi2.rs +++ b/src/hash/arch/x86_64/poseidon_goldilocks_avx2_bmi2.rs @@ -1,5 +1,4 @@ use core::arch::x86_64::*; -use std::convert::TryInto; use std::mem::size_of; use static_assertions::const_assert; diff --git a/src/hash/hash_types.rs b/src/hash/hash_types.rs index eb2f16b0..0fec294b 100644 --- a/src/hash/hash_types.rs +++ b/src/hash/hash_types.rs @@ -1,5 +1,3 @@ -use std::convert::TryInto; - use rand::Rng; use serde::{Deserialize, Serialize}; diff --git a/src/hash/hashing.rs b/src/hash/hashing.rs index 39b3f51e..a4610495 100644 --- a/src/hash/hashing.rs +++ b/src/hash/hashing.rs @@ -1,7 +1,5 @@ //! Concrete instantiation of a hash function. -use std::convert::TryInto; - use crate::field::extension_field::Extendable; use crate::field::field_types::RichField; use crate::hash::hash_types::{HashOut, HashOutTarget}; diff --git a/src/hash/merkle_proofs.rs b/src/hash/merkle_proofs.rs index 20e2271a..b5cb3b20 100644 --- a/src/hash/merkle_proofs.rs +++ b/src/hash/merkle_proofs.rs @@ -1,5 +1,3 @@ -use std::convert::TryInto; - use anyhow::{ensure, Result}; use serde::{Deserialize, Serialize}; diff --git a/src/hash/poseidon.rs b/src/hash/poseidon.rs index 03dce1f3..8572143a 100644 --- a/src/hash/poseidon.rs +++ b/src/hash/poseidon.rs @@ -1,8 +1,6 @@ //! Implementation of the Poseidon hash function, as described in //! https://eprint.iacr.org/2019/458.pdf -use std::convert::TryInto; - use unroll::unroll_for_loops; use crate::field::extension_field::target::ExtensionTarget; diff --git a/src/iop/challenger.rs b/src/iop/challenger.rs index 87b0512d..bd990c6d 100644 --- a/src/iop/challenger.rs +++ b/src/iop/challenger.rs @@ -1,5 +1,3 @@ -use std::convert::TryInto; - use crate::field::extension_field::target::ExtensionTarget; use crate::field::extension_field::{Extendable, FieldExtension}; use crate::field::field_types::RichField; diff --git a/src/iop/witness.rs b/src/iop/witness.rs index 0388a6cb..a773c1a9 100644 --- a/src/iop/witness.rs +++ b/src/iop/witness.rs @@ -1,5 +1,4 @@ use std::collections::HashMap; -use std::convert::TryInto; use num::{BigUint, FromPrimitive, Zero}; diff --git a/src/plonk/circuit_builder.rs b/src/plonk/circuit_builder.rs index fc9eef76..32ea59b6 100644 --- a/src/plonk/circuit_builder.rs +++ b/src/plonk/circuit_builder.rs @@ -1,6 +1,5 @@ use std::cmp::max; use std::collections::{BTreeMap, HashMap, HashSet}; -use std::convert::TryInto; use std::time::Instant; use log::{debug, info, Level}; diff --git a/src/plonk/vars.rs b/src/plonk/vars.rs index 110aa689..b643b7b7 100644 --- a/src/plonk/vars.rs +++ b/src/plonk/vars.rs @@ -1,4 +1,3 @@ -use std::convert::TryInto; use std::ops::Range; use crate::field::extension_field::algebra::ExtensionAlgebra; diff --git a/src/util/serialization.rs b/src/util/serialization.rs index 172b4d67..5ca4f691 100644 --- a/src/util/serialization.rs +++ b/src/util/serialization.rs @@ -1,8 +1,6 @@ use std::collections::HashMap; -use std::convert::TryInto; use std::io::Cursor; use std::io::{Read, Result, Write}; -use std::iter::FromIterator; use crate::field::extension_field::{Extendable, FieldExtension}; use crate::field::field_types::{PrimeField, RichField};