diff --git a/Cargo.toml b/Cargo.toml index fcf1a5aa..f1009940 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -65,7 +65,7 @@ tracing = ["dep:crossbeam-utils", "dep:tracing", "dep:tracing-subscriber"] [dependencies] clap = { version = "4.3.2", features = ["derive", "wrap_help"] } console = "0.15" -derive_more = { version = "0.99.17", features = ["as_ref", "deref", "deref_mut", "display", "error", "from", "from_str", "into"], default-features = false } +derive_more = { version = "1.0", features = ["as_ref", "deref", "deref_mut", "display", "error", "from", "from_str", "into"] } drain_filter_polyfill = "0.1.2" either = "1.6" futures = "0.3.17" @@ -101,7 +101,6 @@ tracing = { version = "0.1", optional = true } tracing-subscriber = { version = "0.3.16", optional = true } [dev-dependencies] -derive_more = "0.99.17" rand = "0.8" tempfile = "3.2" tokio = { version = "1.12", features = ["macros", "rt-multi-thread", "sync", "time"] } diff --git a/codegen/Cargo.toml b/codegen/Cargo.toml index 50bdca76..6126e86c 100644 --- a/codegen/Cargo.toml +++ b/codegen/Cargo.toml @@ -32,7 +32,7 @@ synthez = "0.3" [dev-dependencies] cucumber = { path = "..", features = ["libtest", "macros"] } -derive_more = "0.99.17" +derive_more = { version = "1.0", features = ["as_ref", "deref", "deref_mut", "display", "error", "from", "from_str", "into"] } futures = "0.3.17" tempfile = "3.2" tokio = { version = "1.12", features = ["macros", "rt-multi-thread", "time"] } diff --git a/src/event.rs b/src/event.rs index 69ebe71b..c018e3f4 100644 --- a/src/event.rs +++ b/src/event.rs @@ -405,20 +405,20 @@ pub enum StepError { /// /// [`Regex`]: regex::Regex /// [`fail_on_skipped()`]: crate::WriterExt::fail_on_skipped() - #[display(fmt = "Step doesn't match any function")] + #[display("Step doesn't match any function")] NotFound, /// [`Step`] matches multiple [`Regex`]es. /// /// [`Regex`]: regex::Regex /// [`Step`]: gherkin::Step - #[display(fmt = "Step match is ambiguous: {}", _0)] + #[display("Step match is ambiguous: {}", _0)] AmbiguousMatch(step::AmbiguousMatchError), /// [`Step`] panicked. /// /// [`Step`]: gherkin::Step - #[display(fmt = "Step panicked. Captured output: {}", "coerce_error(_0)")] + #[display("Step panicked. Captured output: {}", coerce_error(_0))] Panic(#[error(not(source))] Info), } diff --git a/src/feature.rs b/src/feature.rs index a9c73b05..ef47d482 100644 --- a/src/feature.rs +++ b/src/feature.rs @@ -229,11 +229,11 @@ fn expand_scenario( /// [1]: https://cucumber.io/docs/gherkin/reference#scenario-outline #[derive(Clone, Debug, Display, Error)] #[display( - fmt = "Failed to resolve <{}> at {}:{}:{}", + "Failed to resolve <{}> at {}:{}:{}", name, - "path.as_deref().and_then(Path::to_str).map(trim_path).unwrap_or_default()", - "pos.line", - "pos.col" + path.as_deref().and_then(Path::to_str).map(trim_path).unwrap_or_default(), + pos.line, + pos.col )] pub struct ExpandExamplesError { /// Position of the unknown template. diff --git a/src/parser/basic.rs b/src/parser/basic.rs index c88f14c6..5f92390f 100644 --- a/src/parser/basic.rs +++ b/src/parser/basic.rs @@ -165,7 +165,7 @@ impl Basic { /// Error of [`gherkin`] not supporting keywords in some language. #[derive(Clone, Debug, Display, Error)] -#[display(fmt = "Language {} isn't supported", _0)] +#[display("Language {} isn't supported", _0)] pub struct UnsupportedLanguageError( #[error(not(source))] pub Cow<'static, str>, ); diff --git a/src/parser/mod.rs b/src/parser/mod.rs index 8ee8600c..865d7844 100644 --- a/src/parser/mod.rs +++ b/src/parser/mod.rs @@ -16,7 +16,7 @@ pub mod basic; use std::sync::Arc; -use derive_more::{Display, Error}; +use derive_more::{Display, Error as DeriveError}; use futures::Stream; use crate::feature::ExpandExamplesError; @@ -57,18 +57,18 @@ pub trait Parser { pub type Result = std::result::Result; /// [`Parser`] error. -#[derive(Clone, Debug, Display, Error)] +#[derive(Clone, Debug, Display, DeriveError)] pub enum Error { /// Failed to parse a [`Feature`]. /// /// [`Feature`]: gherkin::Feature - #[display(fmt = "Failed to parse feature: {}", _0)] + #[display("Failed to parse feature: {}", _0)] Parsing(Arc), /// Failed to expand [`Examples`] /// /// [`Examples`]: gherkin::Examples - #[display(fmt = "Failed to expand examples: {}", _0)] + #[display("Failed to expand examples: {}", _0)] ExampleExpansion(Arc), } diff --git a/src/step.rs b/src/step.rs index 3c55c38a..a5e77fed 100644 --- a/src/step.rs +++ b/src/step.rs @@ -273,7 +273,7 @@ impl fmt::Display for AmbiguousMatchError { /// Location of a [`Step`] [`fn`] automatically filled by a proc macro. #[derive(Clone, Copy, Debug, Display, Eq, Hash, Ord, PartialEq, PartialOrd)] -#[display(fmt = "{}:{}:{}", path, line, column)] +#[display("{}:{}:{}", path, line, column)] pub struct Location { /// Path to the file where [`Step`] [`fn`] is located. pub path: &'static str,