Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor housekeeping work #310

Merged
merged 7 commits into from
Nov 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,17 @@ repository = "https://github.com/cucumber-rs/cucumber"
readme = "README.md"
categories = ["asynchronous", "development-tools::testing"]
keywords = ["cucumber", "testing", "bdd", "atdd", "async"]
include = ["/src/", "/tests/json.rs", "/tests/junit.rs", "/tests/libtest.rs", "/tests/tracing.rs", "/tests/wait.rs", "/LICENSE-*", "/README.md", "/CHANGELOG.md"]
include = [
"/src/",
"/tests/json.rs",
"/tests/junit.rs",
"/tests/libtest.rs",
"/tests/tracing.rs",
"/tests/wait.rs",
"/CHANGELOG.md",
"/LICENSE-*",
"/README.md",
]

[package.metadata.docs.rs]
all-features = true
Expand All @@ -30,9 +40,21 @@ default = ["macros"]
# Enables compatibility with Rust libtest (like outputting in its JSON format).
libtest = ["dep:serde", "dep:serde_json", "timestamps"]
# Enables step attributes and auto-wiring.
macros = ["dep:anyhow", "dep:cucumber-codegen", "dep:cucumber-expressions", "dep:inventory"]
macros = [
"dep:anyhow",
"dep:cucumber-codegen",
"dep:cucumber-expressions",
"dep:inventory",
]
# Enables support for outputting in Cucumber JSON format.
output-json = ["dep:base64", "dep:Inflector", "dep:mime", "dep:serde", "dep:serde_json", "timestamps"]
output-json = [
"dep:base64",
"dep:Inflector",
"dep:mime",
"dep:serde",
"dep:serde_json",
"timestamps",
]
# Enables support for outputting JUnit XML report.
output-junit = ["dep:junit-report", "timestamps"]
# Enables timestamps collecting for all events.
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ cargo.fmt:
# make cargo.lint

cargo.lint:
cargo clippy --workspace -- -D warnings
cargo clippy --workspace --all-features -- -D warnings


Expand Down
4 changes: 4 additions & 0 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ pub struct Event<T: ?Sized> {

impl<T> Event<T> {
/// Creates a new [`Event`] out of the given `value`.
#[cfg_attr(
not(feature = "timestamps"),
allow(clippy::missing_const_for_fn)
)]
#[must_use]
pub fn new(value: T) -> Self {
Self {
Expand Down
8 changes: 4 additions & 4 deletions src/runner/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1074,7 +1074,7 @@ async fn execute<W, Before, After>(
}
}
#[cfg(not(feature = "tracing"))]
let _ = id;
let _: ScenarioId = id;

if fail_fast && scenario_failed && !retried {
started_scenarios = ControlFlow::Break(());
Expand Down Expand Up @@ -1485,7 +1485,7 @@ where
(fut, span_id)
};
#[cfg(not(feature = "tracing"))]
let _ = scenario_id;
let _: ScenarioId = scenario_id;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@barafael I would prefer _ = scenario_id;, but yes:

error[E0658]: attributes on expressions are experimental
    --> src/runner/basic.rs:1076:13
     |
1076 |             #[cfg(not(feature = "tracing"))]
     |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information


let result = fut.then_yield().await;

Expand Down Expand Up @@ -1606,7 +1606,7 @@ where
waiter.wait_for_span_close(id).then_yield().await;
}
#[cfg(not(feature = "tracing"))]
let _ = scenario_id;
let _: ScenarioId = scenario_id;

match result {
Ok((Some(captures), loc, Some(world))) => {
Expand Down Expand Up @@ -1762,7 +1762,7 @@ where
(fut, span_id)
};
#[cfg(not(feature = "tracing"))]
let _ = scenario_id;
let _: ScenarioId = scenario_id;

let res = fut.then_yield().await;

Expand Down
Loading