Skip to content

Commit

Permalink
Upgrade to 1.65 Rust and bump up MSRV
Browse files Browse the repository at this point in the history
- refactor to use `let`-`else` statements
- tune up lints
  • Loading branch information
tyranron committed Nov 4, 2022
1 parent f5bb38d commit 7f52d4a
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ jobs:
strategy:
fail-fast: false
matrix:
msrv: ["1.62.0"]
msrv: ["1.65.0"]
crate:
- cucumber-codegen
- cucumber
Expand Down
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ All user visible changes to `cucumber` crate will be documented in this file. Th



## [0.16.0] · 2022-??-?? (unreleased)
[0.16.0]: /../../tree/v0.16.0

[Diff](/../../compare/v0.15.3...v0.16.0) | [Milestone](/../../milestone/19)

### BC Breaks

- Bumped up [MSRV] to 1.65 for using `let`-`else` statements.




## [0.15.3] · 2022-11-01
[0.15.3]: /../../tree/v0.15.3

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "cucumber"
version = "0.15.3"
edition = "2021"
rust-version = "1.62"
rust-version = "1.65"
description = """\
Cucumber testing framework for Rust, with async support. \
Fully native, no external test runners or dependencies.\
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Cucumber testing framework for Rust
[![Crates.io](https://img.shields.io/crates/v/cucumber.svg?maxAge=2592000)](https://crates.io/crates/cucumber)
[![Documentation](https://docs.rs/cucumber/badge.svg)](https://docs.rs/cucumber)
[![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 1.62+](https://img.shields.io/badge/rustc-1.62+-lightgray.svg "Rust 1.62+")](https://blog.rust-lang.org/2022/06/30/Rust-1.62.0.html)
[![Rust 1.65+](https://img.shields.io/badge/rustc-1.65+-lightgray.svg "Rust 1.65+")](https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html)
[![Unsafe Forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance)

An implementation of the [Cucumber] testing framework for Rust. Fully native, no external test runners or dependencies.
Expand Down
12 changes: 12 additions & 0 deletions codegen/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@ All user visible changes to `cucumber-codegen` crate will be documented in this



## [0.16.0] · 2022-??-?? (unreleased)
[0.16.0]: /../../tree/v0.16.0/codegen

[Milestone](/../../milestone/19)

### BC Breaks

- Bumped up [MSRV] to 1.65 for using `let`-`else` statements.




## [0.15.3] · 2022-11-01
[0.15.3]: /../../tree/v0.15.3/codegen

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.15.3" # should be the same as main crate version
edition = "2021"
rust-version = "1.62"
rust-version = "1.65"
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 @@ -4,7 +4,7 @@
[![Crates.io](https://img.shields.io/crates/v/cucumber-codegen.svg?maxAge=2592000)](https://crates.io/crates/cucumber-codegen)
[![Documentation](https://docs.rs/cucumber-codegen/badge.svg)](https://docs.rs/cucumber-codegen)
[![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 1.62+](https://img.shields.io/badge/rustc-1.62+-lightgray.svg "Rust 1.62+")](https://blog.rust-lang.org/2022/06/30/Rust-1.62.0.html)
[![Rust 1.65+](https://img.shields.io/badge/rustc-1.65+-lightgray.svg "Rust 1.65+")](https://blog.rust-lang.org/2022/11/03/Rust-1.65.0.html)
[![Unsafe Forbidden](https://img.shields.io/badge/unsafe-forbidden-success.svg)](https://github.com/rust-secure-code/safety-dance)

- [Changelog](https://github.com/cucumber-rs/cucumber/blob/main/codegen/CHANGELOG.md)
Expand Down
4 changes: 1 addition & 3 deletions codegen/src/attribute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -828,9 +828,7 @@ fn parse_fn_arg(arg: &syn::FnArg) -> syn::Result<(&syn::Ident, &syn::Type)> {
}
};

let ident = if let syn::Pat::Ident(i) = arg.pat.as_ref() {
&i.ident
} else {
let syn::Pat::Ident(syn::PatIdent{ ident, .. }) = arg.pat.as_ref() else {
return Err(syn::Error::new(arg.span(), "Expected ident"));
};

Expand Down
11 changes: 9 additions & 2 deletions codegen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@
#![forbid(non_ascii_idents, unsafe_code)]
#![warn(
clippy::as_conversions,
clippy::assertions_on_result_states,
clippy::branches_sharing_code,
clippy::clone_on_ref_ptr,
clippy::create_dir,
clippy::dbg_macro,
clippy::debug_assert_with_mut_call,
clippy::decimal_literal_representation,
Expand All @@ -39,6 +41,7 @@
clippy::exit,
clippy::expect_used,
clippy::fallible_impl_from,
clippy::filetype_is_file,
clippy::float_cmp_const,
clippy::fn_to_numeric_cast,
clippy::fn_to_numeric_cast_any,
Expand All @@ -47,9 +50,10 @@
clippy::if_then_some_else_none,
clippy::imprecise_flops,
clippy::index_refutable_slice,
clippy::iter_on_empty_collections,
clippy::iter_on_single_items,
clippy::iter_with_drain,
clippy::large_include_file,
clippy::let_underscore_must_use,
clippy::lossy_float_literal,
clippy::map_err_ignore,
clippy::mem_forget,
Expand All @@ -59,7 +63,6 @@
clippy::mutex_atomic,
clippy::mutex_integer,
clippy::nonstandard_macro_braces,
clippy::only_used_in_recursion,
clippy::option_if_let_else,
clippy::panic_in_result_fn,
clippy::pedantic,
Expand All @@ -70,6 +73,7 @@
clippy::rest_pat_in_fully_bound_structs,
clippy::same_name_method,
clippy::shadow_unrelated,
clippy::significant_drop_in_scrutinee,
clippy::str_to_string,
clippy::string_add,
clippy::string_lit_as_bytes,
Expand All @@ -86,13 +90,16 @@
clippy::unimplemented,
clippy::unnecessary_self_imports,
clippy::unneeded_field_pattern,
clippy::unused_peekable,
clippy::unwrap_in_result,
clippy::unwrap_used,
clippy::use_debug,
clippy::use_self,
clippy::useless_let_if_seq,
clippy::verbose_file_reads,
clippy::wildcard_enum_match_arm,
future_incompatible,
let_underscore_drop,
meta_variable_misuse,
missing_copy_implementations,
missing_debug_implementations,
Expand Down
12 changes: 8 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
html_favicon_url = "https://avatars.githubusercontent.com/u/91469139?s=256"
)]
#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![deny(
macro_use_extern_crate,
nonstandard_style,
Expand All @@ -25,6 +26,7 @@
#![forbid(non_ascii_idents, unsafe_code)]
#![warn(
clippy::as_conversions,
clippy::assertions_on_result_states,
clippy::branches_sharing_code,
clippy::clone_on_ref_ptr,
clippy::create_dir,
Expand All @@ -49,9 +51,10 @@
clippy::if_then_some_else_none,
clippy::imprecise_flops,
clippy::index_refutable_slice,
clippy::iter_on_empty_collections,
clippy::iter_on_single_items,
clippy::iter_with_drain,
clippy::large_include_file,
clippy::let_underscore_must_use,
clippy::lossy_float_literal,
clippy::map_err_ignore,
clippy::mem_forget,
Expand All @@ -61,7 +64,6 @@
clippy::mutex_atomic,
clippy::mutex_integer,
clippy::nonstandard_macro_braces,
clippy::only_used_in_recursion,
clippy::option_if_let_else,
clippy::panic_in_result_fn,
clippy::pedantic,
Expand All @@ -72,6 +74,7 @@
clippy::rest_pat_in_fully_bound_structs,
clippy::same_name_method,
clippy::shadow_unrelated,
clippy::significant_drop_in_scrutinee,
clippy::str_to_string,
clippy::string_add,
clippy::string_lit_as_bytes,
Expand All @@ -88,6 +91,7 @@
clippy::unimplemented,
clippy::unnecessary_self_imports,
clippy::unneeded_field_pattern,
clippy::unused_peekable,
clippy::unwrap_in_result,
clippy::unwrap_used,
clippy::use_debug,
Expand All @@ -96,6 +100,7 @@
clippy::verbose_file_reads,
clippy::wildcard_enum_match_arm,
future_incompatible,
let_underscore_drop,
meta_variable_misuse,
missing_copy_implementations,
missing_debug_implementations,
Expand All @@ -113,7 +118,6 @@
unused_tuple_struct_fields,
variant_size_differences
)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]

pub mod cli;
mod cucumber;
Expand All @@ -131,7 +135,7 @@ pub mod codegen;

// TODO: Remove once tests run without complains about it.
#[cfg(test)]
mod actually_used_crates_in_tests {
mod actually_used_crates_in_tests_and_book {
use humantime as _;
use rand as _;
use tempfile as _;
Expand Down
7 changes: 3 additions & 4 deletions src/runner/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
use std::{
cmp,
collections::HashMap,
fmt, mem,
fmt, iter, mem,
ops::ControlFlow,
panic::{self, AssertUnwindSafe},
sync::{
Expand Down Expand Up @@ -1365,7 +1365,7 @@ where
Ok(Ok(w)) => w,
Ok(Err(e)) => {
let e = event::StepError::Panic(coerce_into_info(
format!("failed to initialize World: {e}"),
format!("failed to initialize `World`: {e}"),
));
return Err((e, None, loc, None));
}
Expand Down Expand Up @@ -1942,8 +1942,7 @@ impl Features {
retries: Option<RetryOptions>,
) {
self.insert_scenarios(
[(scenario_ty, vec![(feature, rule, scenario, retries)])]
.into_iter()
iter::once((scenario_ty, vec![(feature, rule, scenario, retries)]))
.collect(),
)
.await;
Expand Down

0 comments on commit 7f52d4a

Please sign in to comment.