Skip to content

Commit

Permalink
fix: clippy errors for redundant imports (#1255)
Browse files Browse the repository at this point in the history
  • Loading branch information
hackaugusto authored and bobbinth committed Feb 26, 2024
1 parent 0314770 commit 21bd410
Show file tree
Hide file tree
Showing 148 changed files with 338 additions and 340 deletions.
4 changes: 2 additions & 2 deletions air/src/constraints/chiplets/bitwise/mod.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use super::{EvaluationFrame, Felt, FieldElement, Vec};
use super::{EvaluationFrame, Felt, FieldElement};
use crate::{
trace::chiplets::{
bitwise::{NUM_DECOMP_BITS, NUM_SELECTORS, OP_CYCLE_LEN},
BITWISE_A_COL_IDX, BITWISE_A_COL_RANGE, BITWISE_B_COL_IDX, BITWISE_B_COL_RANGE,
BITWISE_OUTPUT_COL_IDX, BITWISE_PREV_OUTPUT_COL_IDX, BITWISE_SELECTOR_COL_IDX,
},
utils::{are_equal, binary_not, is_binary, is_zero, EvaluationResult},
utils::{are_equal, binary_not, collections::*, is_binary, is_zero, EvaluationResult},
ONE, ZERO,
};
use winter_air::TransitionConstraintDegree;
Expand Down
17 changes: 9 additions & 8 deletions air/src/constraints/chiplets/hasher/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use super::{EvaluationFrame, Felt, FieldElement, TransitionConstraintDegree, Vec};
use crate::trace::chiplets::{
hasher::{
Hasher, CAPACITY_LEN, DIGEST_LEN, DIGEST_RANGE, HASH_CYCLE_LEN, NUM_SELECTORS, STATE_WIDTH,
},
HASHER_NODE_INDEX_COL_IDX, HASHER_SELECTOR_COL_RANGE, HASHER_STATE_COL_RANGE,
};
use super::{EvaluationFrame, Felt, FieldElement, TransitionConstraintDegree};
use crate::{
utils::{are_equal, binary_not, is_binary, EvaluationResult},
trace::chiplets::{
hasher::{
Hasher, CAPACITY_LEN, DIGEST_LEN, DIGEST_RANGE, HASH_CYCLE_LEN, NUM_SELECTORS,
STATE_WIDTH,
},
HASHER_NODE_INDEX_COL_IDX, HASHER_SELECTOR_COL_RANGE, HASHER_STATE_COL_RANGE,
},
utils::{are_equal, binary_not, collections::*, is_binary, EvaluationResult},
ONE, ZERO,
};

Expand Down
3 changes: 2 additions & 1 deletion air/src/constraints/chiplets/hasher/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ use super::{
};
use crate::{
trace::chiplets::hasher::{Selectors, LINEAR_HASH, STATE_WIDTH},
utils::collections::*,
Felt, TRACE_WIDTH,
};
use rand_utils::rand_array;
use vm_core::{chiplets::hasher::apply_round, utils::collections::Vec};
use vm_core::chiplets::hasher::apply_round;
use winter_air::EvaluationFrame;

// UNIT TESTS
Expand Down
14 changes: 8 additions & 6 deletions air/src/constraints/chiplets/memory/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use super::{EvaluationFrame, FieldElement, Vec};
use crate::trace::chiplets::{
memory::NUM_ELEMENTS, MEMORY_ADDR_COL_IDX, MEMORY_CLK_COL_IDX, MEMORY_CTX_COL_IDX,
MEMORY_D0_COL_IDX, MEMORY_D1_COL_IDX, MEMORY_D_INV_COL_IDX, MEMORY_TRACE_OFFSET,
MEMORY_V_COL_RANGE,
use super::{EvaluationFrame, FieldElement};
use crate::{
trace::chiplets::{
memory::NUM_ELEMENTS, MEMORY_ADDR_COL_IDX, MEMORY_CLK_COL_IDX, MEMORY_CTX_COL_IDX,
MEMORY_D0_COL_IDX, MEMORY_D1_COL_IDX, MEMORY_D_INV_COL_IDX, MEMORY_TRACE_OFFSET,
MEMORY_V_COL_RANGE,
},
utils::{binary_not, collections::*, is_binary, EvaluationResult},
};
use crate::utils::{binary_not, is_binary, EvaluationResult};
use winter_air::TransitionConstraintDegree;

#[cfg(test)]
Expand Down
3 changes: 1 addition & 2 deletions air/src/constraints/chiplets/memory/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ use crate::trace::{
},
TRACE_WIDTH,
};
use crate::{chiplets::memory, Felt, FieldElement, ONE, ZERO};
use crate::{chiplets::memory, utils::collections::*, Felt, FieldElement, ONE, ZERO};
use rand_utils::rand_value;
use vm_core::utils::collections::Vec;

// UNIT TESTS
// ================================================================================================
Expand Down
4 changes: 2 additions & 2 deletions air/src/constraints/chiplets/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::super::{
EvaluationFrame, Felt, FieldElement, TransitionConstraintDegree, Vec, CHIPLETS_OFFSET,
EvaluationFrame, Felt, FieldElement, TransitionConstraintDegree, CHIPLETS_OFFSET,
};
use crate::utils::{are_equal, binary_not, is_binary};
use crate::utils::{are_equal, binary_not, collections::*, is_binary};

mod bitwise;
mod hasher;
Expand Down
4 changes: 2 additions & 2 deletions air/src/constraints/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ use crate::{
chiplets::ChipletsFrameExt,
constraints::MainFrameExt,
trace::range::{B_RANGE_COL_IDX, M_COL_IDX, V_COL_IDX},
utils::are_equal,
utils::{are_equal, collections::*},
Assertion, EvaluationFrame, Felt, FieldElement, TransitionConstraintDegree,
};
use vm_core::{utils::collections::Vec, ExtensionOf, ZERO};
use vm_core::{ExtensionOf, ZERO};
use winter_air::AuxTraceRandElements;

// CONSTANTS
Expand Down
6 changes: 2 additions & 4 deletions air/src/constraints/stack/field_ops/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use super::{op_flags::OpFlags, EvaluationFrame, Vec};
use super::{op_flags::OpFlags, EvaluationFrame, FieldElement, TransitionConstraintDegree};
use crate::{
stack::EvaluationFrameExt,
utils::{are_equal, is_binary},
utils::{are_equal, collections::*, is_binary},
};
use vm_core::FieldElement;
use winter_air::TransitionConstraintDegree;

#[cfg(test)]
pub mod tests;
Expand Down
9 changes: 5 additions & 4 deletions air/src/constraints/stack/io_ops/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use super::{op_flags::OpFlags, EvaluationFrame, Vec};
use crate::{stack::EvaluationFrameExt, utils::are_equal};
use vm_core::FieldElement;
use winter_air::TransitionConstraintDegree;
use super::{op_flags::OpFlags, EvaluationFrame, FieldElement, TransitionConstraintDegree};
use crate::{
stack::EvaluationFrameExt,
utils::{are_equal, collections::*},
};

#[cfg(test)]
pub mod tests;
Expand Down
4 changes: 2 additions & 2 deletions air/src/constraints/stack/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ use super::super::{
STACK_AUX_TRACE_OFFSET, STACK_TRACE_OFFSET, ZERO,
};
use crate::decoder::{IS_CALL_FLAG_COL_IDX, IS_SYSCALL_FLAG_COL_IDX, USER_OP_HELPERS_OFFSET};
use crate::utils::{are_equal, is_binary};
use vm_core::{stack::STACK_TOP_SIZE, utils::collections::Vec, StackOutputs};
use crate::utils::{are_equal, collections::*, is_binary};
use vm_core::{stack::STACK_TOP_SIZE, StackOutputs};

pub mod field_ops;
pub mod io_ops;
Expand Down
6 changes: 2 additions & 4 deletions air/src/constraints/stack/overflow/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use super::{op_flags::OpFlags, EvaluationFrame, Vec};
use crate::stack::EvaluationFrameExt;
use vm_core::FieldElement;
use winter_air::TransitionConstraintDegree;
use super::{op_flags::OpFlags, EvaluationFrame, FieldElement, TransitionConstraintDegree};
use crate::{stack::EvaluationFrameExt, utils::collections::*};

#[cfg(test)]
pub mod tests;
Expand Down
6 changes: 2 additions & 4 deletions air/src/constraints/stack/stack_manipulation/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use super::{op_flags::OpFlags, EvaluationFrame, Vec};
use super::{op_flags::OpFlags, EvaluationFrame, FieldElement, TransitionConstraintDegree};
use crate::{
stack::EvaluationFrameExt,
utils::{are_equal, binary_not},
utils::{are_equal, binary_not, collections::*},
};
use vm_core::FieldElement;
use winter_air::TransitionConstraintDegree;

#[cfg(test)]
pub mod tests;
Expand Down
9 changes: 5 additions & 4 deletions air/src/constraints/stack/system_ops/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use super::{op_flags::OpFlags, EvaluationFrame, Vec};
use crate::{stack::EvaluationFrameExt, utils::are_equal};
use vm_core::FieldElement;
use winter_air::TransitionConstraintDegree;
use super::{op_flags::OpFlags, EvaluationFrame, FieldElement, TransitionConstraintDegree};
use crate::{
stack::EvaluationFrameExt,
utils::{are_equal, collections::*},
};

#[cfg(test)]
pub mod tests;
Expand Down
6 changes: 2 additions & 4 deletions air/src/constraints/stack/u32_ops/mod.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
use super::{op_flags::OpFlags, EvaluationFrame, Vec};
use super::{op_flags::OpFlags, EvaluationFrame, Felt, FieldElement, TransitionConstraintDegree};
use crate::{
stack::EvaluationFrameExt,
utils::{are_equal, is_binary},
utils::{are_equal, collections::*, is_binary},
};
use vm_core::{Felt, FieldElement};
use winter_air::TransitionConstraintDegree;

#[cfg(test)]
pub mod tests;
Expand Down
3 changes: 1 addition & 2 deletions air/src/errors.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use super::String;
use crate::trace::MIN_TRACE_LEN;
use crate::{trace::MIN_TRACE_LEN, utils::string::*};
use core::fmt::{Display, Formatter};

// EXECUTION ERROR
Expand Down
6 changes: 2 additions & 4 deletions air/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
extern crate alloc;

use vm_core::{
utils::{
collections::Vec, string::String, ByteReader, ByteWriter, Deserializable, Serializable,
},
utils::{collections::*, ByteReader, ByteWriter, Deserializable, Serializable},
ExtensionOf, ProgramInfo, StackInputs, StackOutputs, ONE, ZERO,
};
use winter_air::{
Expand All @@ -30,7 +28,7 @@ mod proof;
mod utils;
use utils::TransitionConstraintRange;

// EXPORTS
// RE-EXPORTS
// ================================================================================================

pub use errors::ExecutionOptionsError;
Expand Down
5 changes: 3 additions & 2 deletions air/src/proof.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use super::DeserializationError;
use vm_core::{
crypto::hash::{Blake3_192, Blake3_256, Hasher, Rpo256},
utils::{collections::Vec, ByteReader, ByteWriter, Deserializable, Serializable},
utils::{
collections::*, ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable,
},
};
use winter_air::proof::StarkProof;

Expand Down
3 changes: 1 addition & 2 deletions air/src/trace/main_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@ use super::{
CHIPLETS_OFFSET, CLK_COL_IDX, CTX_COL_IDX, DECODER_TRACE_OFFSET, FMP_COL_IDX, FN_HASH_OFFSET,
STACK_TRACE_OFFSET,
};
use crate::utils::collections::*;
use core::ops::{Deref, Range};
#[cfg(any(test, feature = "internals"))]
use vm_core::utils::collections::Vec;
use vm_core::{utils::range, Felt, ONE, ZERO};

// CONSTANTS
Expand Down
6 changes: 5 additions & 1 deletion air/src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
use super::FieldElement;
use core::ops::Range;
use vm_core::{utils::collections::Vec, utils::range as create_range};
use vm_core::utils::{collections::*, range as create_range};

// RE-EXPORTS
// ================================================================================================
pub use vm_core::utils::{collections, string};

// BASIC CONSTRAINT OPERATORS
// ================================================================================================
Expand Down
10 changes: 6 additions & 4 deletions assembly/src/assembler/context.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use super::{
AssemblyError, BTreeMap, CallSet, CodeBlock, CodeBlockTable, Kernel, LibraryPath,
NamedProcedure, Procedure, ProcedureCache, ProcedureId, ProcedureName, RpoDigest, ToString,
Vec,
AssemblyError, CallSet, CodeBlock, CodeBlockTable, Kernel, LibraryPath, NamedProcedure,
Procedure, ProcedureCache, ProcedureId, ProcedureName, RpoDigest,
};
use crate::{
ast::{ModuleAst, ProgramAst},
utils::{collections::*, string::*},
};
use crate::ast::{ModuleAst, ProgramAst};

// ASSEMBLY CONTEXT
// ================================================================================================
Expand Down
5 changes: 3 additions & 2 deletions assembly/src/assembler/instruction/procedures.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use super::{
super::Vec, Assembler, AssemblyContext, AssemblyError, CodeBlock, Operation, ProcedureId,
RpoDigest, SpanBuilder,
Assembler, AssemblyContext, AssemblyError, CodeBlock, Operation, ProcedureId, RpoDigest,
SpanBuilder,
};
use crate::utils::collections::*;

// PROCEDURE INVOCATIONS
// ================================================================================================
Expand Down
10 changes: 5 additions & 5 deletions assembly/src/assembler/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use super::ast::instrument;
use super::{
ast::{Instruction, ModuleAst, Node, ProcedureAst, ProgramAst},
ast::{instrument, Instruction, ModuleAst, Node, ProcedureAst, ProgramAst},
btree_map,
crypto::hash::RpoDigest,
AssemblyError, BTreeMap, CallSet, CodeBlock, CodeBlockTable, Felt, Kernel, Library,
LibraryError, LibraryPath, Module, NamedProcedure, Operation, Procedure, ProcedureId,
ProcedureName, Program, ToString, Vec, ONE, ZERO,
ProcedureName, Program, ONE, ZERO,
};
use crate::utils::collections::*;
use core::{borrow::Borrow, cell::RefCell};
use vm_core::{utils::group_vector_elements, Decorator, DecoratorList};

Expand Down Expand Up @@ -196,8 +196,8 @@ impl Assembler {
/// - If a module with the same path already exists in the module stack of the
/// [AssemblyContext].
/// - If a lock to the [ProcedureCache] can not be attained.
#[instrument(level = "trace",
name = "compile_module",
#[instrument(level = "trace",
name = "compile_module",
fields(module = path.unwrap_or(&LibraryPath::anon_path()).path()), skip_all)]
pub fn compile_module(
&self,
Expand Down
3 changes: 2 additions & 1 deletion assembly/src/assembler/module_provider.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use super::{BTreeMap, Library, LibraryError, Module, ProcedureId, Vec};
use super::{Library, LibraryError, Module, ProcedureId};
use crate::utils::collections::*;

// MODULE PROVIDER
// ================================================================================================
Expand Down
3 changes: 2 additions & 1 deletion assembly/src/assembler/span_builder.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use super::{
AssemblyContext, AssemblyError, BodyWrapper, Borrow, CodeBlock, Decorator, DecoratorList,
Instruction, Operation, ToString, Vec,
Instruction, Operation,
};
use crate::utils::{collections::*, string::*};
use vm_core::{AdviceInjector, AssemblyOp};

// SPAN BUILDER
Expand Down
3 changes: 2 additions & 1 deletion assembly/src/ast/code_body.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use super::{
ByteReader, ByteWriter, Deserializable, DeserializationError, Node, Serializable,
SourceLocation, Vec, MAX_BODY_LEN,
SourceLocation, MAX_BODY_LEN,
};
use crate::utils::collections::*;
use core::{iter, slice};

// CODE BODY
Expand Down
3 changes: 2 additions & 1 deletion assembly/src/ast/format.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use super::{
CodeBody, FormattableNode, InvokedProcsMap, LibraryPath, ProcedureAst, ProcedureId,
ProcedureName, Vec,
ProcedureName,
};
use crate::utils::collections::*;
use core::fmt;

const INDENT_STRING: &str = " ";
Expand Down
7 changes: 4 additions & 3 deletions assembly/src/ast/imports.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
use super::{
BTreeMap, ByteReader, ByteWriter, Deserializable, DeserializationError, InvokedProcsMap,
LibraryPath, ParsingError, ProcedureId, ProcedureName, Serializable, String, ToString, Token,
TokenStream, Vec, MAX_IMPORTS, MAX_INVOKED_IMPORTED_PROCS,
ByteReader, ByteWriter, Deserializable, DeserializationError, InvokedProcsMap, LibraryPath,
ParsingError, ProcedureId, ProcedureName, Serializable, Token, TokenStream, MAX_IMPORTS,
MAX_INVOKED_IMPORTED_PROCS,
};
use crate::utils::{collections::*, string::*};

// TYPE ALIASES
// ================================================================================================
Expand Down
8 changes: 4 additions & 4 deletions assembly/src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
//! Structs in this module (specifically [ProgramAst] and [ModuleAst]) can be used to parse source
//! code into relevant ASTs. This can be done via their `parse()` methods.
use super::{
crypto::hash::RpoDigest, BTreeMap, ByteReader, ByteWriter, Deserializable,
DeserializationError, Felt, LabelError, LibraryPath, ParsingError, ProcedureId, ProcedureName,
Serializable, SliceReader, StarkField, String, ToString, Token, TokenStream, Vec,
MAX_LABEL_LEN,
crypto::hash::RpoDigest, ByteReader, ByteWriter, Deserializable, DeserializationError, Felt,
LabelError, LibraryPath, ParsingError, ProcedureId, ProcedureName, Serializable, SliceReader,
StarkField, Token, TokenStream, MAX_LABEL_LEN,
};
use crate::utils::{collections::*, string::*};
use vm_core::utils::bound_into_included_u64;

pub use tracing::{event, info_span, instrument, Level};
Expand Down
3 changes: 2 additions & 1 deletion assembly/src/ast/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ use super::{
MAX_LOCAL_PROCS, MAX_REEXPORTED_PROCS,
{
ByteReader, ByteWriter, Deserializable, DeserializationError, ParsingError, SliceReader,
String, ToString, Token, TokenStream, Vec,
Token, TokenStream,
},
};
use crate::utils::{collections::*, string::*};

use core::{fmt, str::from_utf8};
use vm_core::utils::Serializable;
Expand Down
3 changes: 2 additions & 1 deletion assembly/src/ast/nodes/advice.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
use super::{
super::{
ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable, ToString,
ByteReader, ByteWriter, Deserializable, DeserializationError, Serializable,
MAX_STACK_WORD_OFFSET,
},
serde::signatures,
};
use crate::utils::string::*;
use core::fmt;
use vm_core::{AdviceInjector, Felt, SignatureKind, ZERO};

Expand Down
Loading

0 comments on commit 21bd410

Please sign in to comment.