Skip to content

Commit 7841427

Browse files
authored
Merge pull request #292 from 0xPolygonMiden/greenhat/clippy-in-tests
chore: fix clippy warnings in tests
2 parents 81e81e4 + ba3a6ee commit 7841427

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

Makefile.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ args = ["serve", "--open", "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/docs"]
290290
description = "Runs clippy on the workspace"
291291
category = "Development"
292292
command = "cargo"
293-
args = ["clippy", "--all", "--", "-D", "clippy::all", "-D", "warnings"]
293+
args = ["clippy", "--all", "--all-targets", "--", "-D", "clippy::all", "-D", "warnings"]
294294
dependencies = ["install-clippy"]
295295

296296
[tasks.install-clippy]

codegen/masm/src/packaging/tests.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,7 @@ fn example_package(context: &TestContext) -> Result<Arc<Package>, Report> {
105105
let offset_u64 = foo_ty.get(2).offset as usize;
106106
let foo_ty = Type::Struct(foo_ty);
107107
let foo_size = foo_ty.size_in_bytes();
108-
let mut data = Vec::<u8>::with_capacity(foo_size);
109-
data.resize(foo_size, 0);
108+
let mut data = vec![0u8; foo_size];
110109
unsafe {
111110
let data_ptr_range = data.as_mut_ptr_range();
112111
core::ptr::write(data_ptr_range.start.byte_add(offset_u8), 1u8);

midenc-debug/src/config.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,8 @@ mod tests {
208208
let file = toml::from_str::<DebuggerConfig>(&text).unwrap();
209209
assert!(file.inputs.values().is_empty());
210210
assert!(file.advice_inputs.stack().is_empty());
211-
assert_eq!(file.options.enable_tracing(), true);
212-
assert_eq!(file.options.enable_debugging(), true);
211+
assert!(file.options.enable_tracing());
212+
assert!(file.options.enable_debugging());
213213
assert_eq!(file.options.max_cycles(), u32::MAX);
214214
assert_eq!(file.options.expected_cycles(), 64);
215215
}
@@ -226,8 +226,8 @@ mod tests {
226226
let file = DebuggerConfig::parse_str(&text).unwrap();
227227
assert!(file.inputs.values().is_empty());
228228
assert!(file.advice_inputs.stack().is_empty());
229-
assert_eq!(file.options.enable_tracing(), true);
230-
assert_eq!(file.options.enable_debugging(), true);
229+
assert!(file.options.enable_tracing());
230+
assert!(file.options.enable_debugging());
231231
assert_eq!(file.options.max_cycles(), 1000);
232232
assert_eq!(file.options.expected_cycles(), 64);
233233
}
@@ -246,8 +246,8 @@ mod tests {
246246
let file = DebuggerConfig::parse_str(&text).unwrap();
247247
assert_eq!(file.inputs.values(), &[RawFelt::new(3), RawFelt::new(2), RawFelt::new(1)]);
248248
assert!(file.advice_inputs.stack().is_empty());
249-
assert_eq!(file.options.enable_tracing(), true);
250-
assert_eq!(file.options.enable_debugging(), true);
249+
assert!(file.options.enable_tracing());
250+
assert!(file.options.enable_debugging());
251251
assert_eq!(file.options.max_cycles(), 1000);
252252
assert_eq!(file.options.expected_cycles(), 64);
253253
}
@@ -283,8 +283,8 @@ mod tests {
283283
file.advice_inputs.mapped_values(&digest),
284284
Some([RawFelt::new(1), RawFelt::new(2), RawFelt::new(3), RawFelt::new(4)].as_slice())
285285
);
286-
assert_eq!(file.options.enable_tracing(), true);
287-
assert_eq!(file.options.enable_debugging(), true);
286+
assert!(file.options.enable_tracing());
287+
assert!(file.options.enable_debugging());
288288
assert_eq!(file.options.max_cycles(), 1000);
289289
assert_eq!(file.options.expected_cycles(), 64);
290290
}

0 commit comments

Comments
 (0)