Skip to content

Commit

Permalink
Tune lints for 1.83 Rust
Browse files Browse the repository at this point in the history
- bump up MSRV to 1.83
  • Loading branch information
tyranron committed Nov 29, 2024
1 parent c506821 commit b46930c
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:
strategy:
fail-fast: false
matrix:
msrv: ["1.81.0"]
msrv: ["1.83.0"]
crate:
- cucumber-codegen
- cucumber
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ All user visible changes to `cucumber` crate will be documented in this file. Th

### BC Breaks

- Bumped up [MSRV] to 1.81 to get rid of `once_cell` crate and for `#[expect]` attribute usage. ([4010c1ad], [f1307038])
- Bumped up [MSRV] to 1.83 to get rid of `once_cell` crate and for `#[expect]` attribute usage. ([4010c1ad], [f1307038], [todo])

[4010c1ad]: /../../commit/4010c1ad6a53d6b7f0b28cefea73c8c13e880e9f
[f1307038]: /../../commit/f1307038cb6b1e38c1cc259a0e09fb583033d0cf
[todo]: /../../commit/todo



Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "cucumber"
version = "0.21.1"
edition = "2021"
rust-version = "1.81"
rust-version = "1.83"
description = """\
Cucumber testing framework for Rust, with async support. \
Fully native, no external test runners or dependencies.\
Expand Down Expand Up @@ -89,7 +89,7 @@ inventory = { version = "0.3", optional = true }
base64 = { version = "0.22", optional = true }
Inflector = { version = "0.11", default-features = false, optional = true }
mime = { version = "0.3.16", optional = true }
serde = { version = "1.0.103", features = ["derive"], optional = true }
serde = { version = "1.0.157", features = ["derive"], optional = true }
serde_json = { version = "1.0.18", optional = true }

# "output-junit" feature dependencies.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Cucumber testing framework for Rust
===================================

[![crates.io](https://img.shields.io/crates/v/cucumber.svg?maxAge=2592000 "crates.io")](https://crates.io/crates/cucumber)
[![Rust 1.81+](https://img.shields.io/badge/rustc-1.81+-lightgray.svg "Rust 1.81+")](https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html)
[![Rust 1.83+](https://img.shields.io/badge/rustc-1.83+-lightgray.svg "Rust 1.83+")](https://blog.rust-lang.org/2024/11/28/Rust-1.83.0.html)
[![Unsafe Forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg "Unsafe forbidden")](https://github.com/rust-secure-code/safety-dance)
[![CI](https://github.com/cucumber-rs/cucumber/workflows/CI/badge.svg?branch=main "CI")](https://github.com/cucumber-rs/cucumber/actions?query=workflow%3ACI+branch%3Amain)
[![Rust docs](https://docs.rs/cucumber/badge.svg "Rust docs")](https://docs.rs/cucumber)
Expand Down
3 changes: 2 additions & 1 deletion codegen/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ All user visible changes to `cucumber-codegen` crate will be documented in this

### BC Breaks

- Bumped up [MSRV] to 1.81 to get rid of `once_cell` crate and for `#[expect]` attribute usage. ([4010c1ad], [f1307038])
- Bumped up [MSRV] to 1.83 to get rid of `once_cell` crate and for `#[expect]` attribute usage. ([4010c1ad], [f1307038], [todo])

[4010c1ad]: /../../commit/4010c1ad6a53d6b7f0b28cefea73c8c13e880e9f
[f1307038]: /../../commit/f1307038cb6b1e38c1cc259a0e09fb583033d0cf
[todo]: /../../commit/todo



Expand Down
2 changes: 1 addition & 1 deletion codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "cucumber-codegen"
version = "0.21.1" # should be the same as main crate version
edition = "2021"
rust-version = "1.81"
rust-version = "1.83"
description = "Code generation for `cucumber` crate."
license = "MIT OR Apache-2.0"
authors = [
Expand Down
2 changes: 1 addition & 1 deletion codegen/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
========================

[![crates.io](https://img.shields.io/crates/v/cucumber-codegen.svg?maxAge=2592000 "crates.io")](https://crates.io/crates/cucumber-codegen)
[![Rust 1.81+](https://img.shields.io/badge/rustc-1.81+-lightgray.svg "Rust 1.81+")](https://blog.rust-lang.org/2024/09/05/Rust-1.81.0.html)
[![Rust 1.83+](https://img.shields.io/badge/rustc-1.83+-lightgray.svg "Rust 1.83+")](https://blog.rust-lang.org/2024/11/28/Rust-1.83.0.html)
[![Unsafe Forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg "Unsafe forbidden")](https://github.com/rust-secure-code/safety-dance)
[![CI](https://github.com/cucumber-rs/cucumber/workflows/CI/badge.svg?branch=main "CI")](https://github.com/cucumber-rs/cucumber/actions?query=workflow%3ACI+branch%3Amain)
[![Rust docs](https://docs.rs/cucumber-codegen/badge.svg "Rust docs")](https://docs.rs/cucumber-codegen)
Expand Down
7 changes: 2 additions & 5 deletions codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
clippy::derive_partial_eq_without_eq,
clippy::else_if_without_else,
clippy::empty_drop,
clippy::empty_line_after_outer_attr,
clippy::empty_structs_with_brackets,
clippy::equatable_if_let,
clippy::empty_enum_variants_with_brackets,
Expand All @@ -51,13 +50,11 @@
clippy::fallible_impl_from,
clippy::filetype_is_file,
clippy::float_cmp_const,
clippy::fn_to_numeric_cast,
clippy::fn_to_numeric_cast_any,
clippy::format_push_string,
clippy::get_unwrap,
clippy::if_then_some_else_none,
clippy::imprecise_flops,
clippy::index_refutable_slice,
clippy::infinite_loop,
clippy::iter_on_empty_collections,
clippy::iter_on_single_items,
Expand All @@ -67,7 +64,6 @@
clippy::large_stack_frames,
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::map_err_ignore,
clippy::mem_forget,
clippy::missing_assert_message,
Expand All @@ -81,6 +77,7 @@
clippy::needless_collect,
clippy::needless_pass_by_ref_mut,
clippy::needless_raw_strings,
clippy::non_zero_suggestions,
clippy::nonstandard_macro_braces,
clippy::option_if_let_else,
clippy::or_fun_call,
Expand All @@ -91,7 +88,6 @@
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 Expand Up @@ -132,6 +128,7 @@
clippy::unneeded_field_pattern,
clippy::unused_peekable,
clippy::unused_result_ok,
clippy::unused_trait_names,
clippy::unwrap_in_result,
clippy::unwrap_used,
clippy::use_debug,
Expand Down
7 changes: 2 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
clippy::derive_partial_eq_without_eq,
clippy::else_if_without_else,
clippy::empty_drop,
clippy::empty_line_after_outer_attr,
clippy::empty_structs_with_brackets,
clippy::equatable_if_let,
clippy::empty_enum_variants_with_brackets,
Expand All @@ -52,13 +51,11 @@
clippy::fallible_impl_from,
clippy::filetype_is_file,
clippy::float_cmp_const,
clippy::fn_to_numeric_cast,
clippy::fn_to_numeric_cast_any,
clippy::format_push_string,
clippy::get_unwrap,
clippy::if_then_some_else_none,
clippy::imprecise_flops,
clippy::index_refutable_slice,
clippy::infinite_loop,
clippy::iter_on_empty_collections,
clippy::iter_on_single_items,
Expand All @@ -68,7 +65,6 @@
clippy::large_stack_frames,
clippy::let_underscore_untyped,
clippy::lossy_float_literal,
clippy::manual_c_str_literals,
clippy::map_err_ignore,
clippy::mem_forget,
clippy::missing_assert_message,
Expand All @@ -82,6 +78,7 @@
clippy::needless_collect,
clippy::needless_pass_by_ref_mut,
clippy::needless_raw_strings,
clippy::non_zero_suggestions,
clippy::nonstandard_macro_braces,
clippy::option_if_let_else,
clippy::or_fun_call,
Expand All @@ -92,7 +89,6 @@
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 Expand Up @@ -133,6 +129,7 @@
clippy::unneeded_field_pattern,
clippy::unused_peekable,
clippy::unused_result_ok,
clippy::unused_trait_names,
clippy::unwrap_in_result,
clippy::unwrap_used,
clippy::use_debug,
Expand Down
14 changes: 3 additions & 11 deletions src/runner/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -898,8 +898,6 @@ async fn insert_features<W, S, F>(
#[expect(clippy::too_many_lines, reason = "needs refactoring")]
#[cfg_attr(
feature = "tracing",
// TODO: Try remove on next Rust version update.
expect(clippy::duplicated_attributes, reason = "false positive"),
expect(clippy::too_many_arguments, reason = "needs refactoring")
)]
async fn execute<W, Before, After>(
Expand Down Expand Up @@ -955,13 +953,6 @@ async fn execute<W, Before, After>(

executor.send_event(event::Cucumber::Started);

// TODO: Replace with `ControlFlow::map_break()` once stabilized:
// https://github.com/rust-lang/rust/issues/75744
let map_break = |cf| match cf {
ControlFlow::Continue(cont) => cont,
ControlFlow::Break(()) => Some(0),
};

#[cfg(feature = "tracing")]
let waiter = logs_collector
.as_ref()
Expand All @@ -970,8 +961,9 @@ async fn execute<W, Before, After>(
let mut started_scenarios = ControlFlow::Continue(max_concurrent_scenarios);
let mut run_scenarios = stream::FuturesUnordered::new();
loop {
let (runnable, sleep) =
features.get(map_break(started_scenarios)).await;
let (runnable, sleep) = features
.get(started_scenarios.continue_value().unwrap_or(Some(0)))
.await;
if run_scenarios.is_empty() && runnable.is_empty() {
if features.is_finished(started_scenarios.is_break()).await {
break;
Expand Down
2 changes: 1 addition & 1 deletion src/writer/out.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

use std::{
borrow::Cow,
io::{self, IsTerminal},
io::{self, IsTerminal as _},
mem, str,
};

Expand Down

0 comments on commit b46930c

Please sign in to comment.