Skip to content

Commit

Permalink
Tune lints for 1.78 Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
tyranron committed May 2, 2024
1 parent c0e50e3 commit df19e86
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
2 changes: 2 additions & 0 deletions codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
clippy::large_stack_frames,
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::manual_clamp,
clippy::map_err_ignore,
clippy::mem_forget,
Expand All @@ -87,6 +88,7 @@
clippy::print_stderr,
clippy::print_stdout,
clippy::pub_without_shorthand,
clippy::ref_as_ptr,
clippy::rc_buffer,
clippy::rc_mutex,
clippy::read_zero_byte_vec,
Expand Down
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
clippy::large_stack_frames,
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::manual_clamp,
clippy::map_err_ignore,
clippy::mem_forget,
Expand All @@ -88,6 +89,7 @@
clippy::print_stderr,
clippy::print_stdout,
clippy::pub_without_shorthand,
clippy::ref_as_ptr,
clippy::rc_buffer,
clippy::rc_mutex,
clippy::read_zero_byte_vec,
Expand Down
16 changes: 8 additions & 8 deletions src/runner/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2275,14 +2275,7 @@ impl Features {
}
}

if without_retries.get(&ScenarioType::Serial).is_none() {
// If there are no Serial Scenarios, we just extend already existing
// Concurrent Scenarios.
#[allow(clippy::iter_over_hash_type)] // order doesn't matter here
for (which, values) in without_retries {
storage.entry(which).or_default().extend(values);
}
} else {
if without_retries.contains_key(&ScenarioType::Serial) {
// If there are Serial Scenarios we insert all Serial and Concurrent
// Scenarios in front.
// This is done to execute them closely to one another, so the
Expand All @@ -2293,6 +2286,13 @@ impl Features {
values.extend(old);
storage.entry(which).or_default().extend(values);
}
} else {
// If there are no Serial Scenarios, we just extend already existing
// Concurrent Scenarios.
#[allow(clippy::iter_over_hash_type)] // order doesn't matter here
for (which, values) in without_retries {
storage.entry(which).or_default().extend(values);
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/writer/json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl<W: World + Debug, Out: io::Write> Writer<W> for Json<Out> {
) {
use event::{Cucumber, Rule};

match event.map(event::Event::split) {
match event.map(Event::split) {
Err(parser::Error::Parsing(e)) => {
let feature = Feature::parsing_err(&e);
self.features.push(feature);
Expand Down
4 changes: 2 additions & 2 deletions src/writer/libtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,8 @@ impl<W: Debug + World> Libtest<W, io::Stdout> {
pub fn or<AnotherWriter: Writer<W>>(
writer: AnotherWriter,
) -> Or<W, AnotherWriter> {
writer::Or::new(writer, Self::stdout(), |_, cli| {
!matches!(cli.right.format, Some(writer::libtest::Format::Json))
Or::new(writer, Self::stdout(), |_, cli| {
!matches!(cli.right.format, Some(Format::Json))
})
}

Expand Down

0 comments on commit df19e86

Please sign in to comment.