Skip to content
Closed
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
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"] }
Expand Down
2 changes: 1 addition & 1 deletion codegen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"] }
Expand Down
6 changes: 3 additions & 3 deletions src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),
}

Expand Down
8 changes: 4 additions & 4 deletions src/feature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/parser/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
);
Expand Down
8 changes: 4 additions & 4 deletions src/parser/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -57,18 +57,18 @@ pub trait Parser<I> {
pub type Result<T> = std::result::Result<T, Error>;

/// [`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<gherkin::ParseFileError>),

/// Failed to expand [`Examples`]
///
/// [`Examples`]: gherkin::Examples
#[display(fmt = "Failed to expand examples: {}", _0)]
#[display("Failed to expand examples: {}", _0)]
ExampleExpansion(Arc<ExpandExamplesError>),
}

Expand Down
2 changes: 1 addition & 1 deletion src/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down