Skip to content

Commit 78aba71

Browse files
committed
Update derive_more requirement to 1.0
1 parent 58f4d28 commit 78aba71

File tree

3 files changed

+26
-26
lines changed

3 files changed

+26
-26
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ rustdoc-args = ["--cfg", "docsrs"]
2626
into-regex = ["dep:either", "dep:regex", "dep:regex-syntax"]
2727

2828
[dependencies]
29-
derive_more = { version = "0.99.17", features = ["as_ref", "deref", "deref_mut", "display", "error", "from", "into"], default-features = false }
29+
derive_more = { version = "1.0", features = ["as_ref", "deref", "deref_mut", "display", "error", "from", "into"] }
3030
nom = "7.0"
3131
nom_locate = "4.0"
3232

src/expand/mod.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub mod parameters;
2121

2222
use std::{fmt, iter, str, vec};
2323

24-
use derive_more::{Display, Error, From};
24+
use derive_more::{Display, Error as DeriveError, From};
2525
use either::Either;
2626
use nom::{AsChar, InputIter};
2727
use regex::Regex;
@@ -140,37 +140,37 @@ impl<'s> Expression<Spanned<'s>> {
140140
/// [Cucumber Expression][0] and expanding it into a [`Regex`].
141141
///
142142
/// [0]: https://github.com/cucumber/cucumber-expressions#readme
143-
#[derive(Clone, Debug, Display, Error, From)]
143+
#[derive(Clone, Debug, Display, DeriveError, From)]
144144
pub enum Error<Input>
145145
where
146146
Input: fmt::Display,
147147
{
148148
/// Parsing error.
149-
#[display(fmt = "Parsing failed: {}", _0)]
149+
#[display("Parsing failed: {}", _0)]
150150
Parsing(parse::Error<Input>),
151151

152152
/// Expansion error.
153-
#[display(fmt = "Failed to expand regex: {}", _0)]
153+
#[display("Failed to expand regex: {}", _0)]
154154
Expansion(ParameterError<Input>),
155155

156156
/// [`Regex`] creation error.
157-
#[display(fmt = "Regex creation failed: {}", _0)]
157+
#[display("Regex creation failed: {}", _0)]
158158
Regex(regex::Error),
159159
}
160160

161161
/// Possible [`Parameter`] errors being used in an [`Expression`].
162-
#[derive(Clone, Debug, Display, Error)]
162+
#[derive(Clone, Debug, Display, DeriveError)]
163163
pub enum ParameterError<Input>
164164
where
165165
Input: fmt::Display,
166166
{
167167
/// [`Parameter`] not found.
168-
#[display(fmt = "Parameter `{}` not found.", _0)]
168+
#[display("Parameter `{}` not found.", _0)]
169169
NotFound(Input),
170170

171171
/// Failed to rename [`Regex`] capturing group.
172172
#[display(
173-
fmt = "Failed to rename capturing groups in regex `{}` of \
173+
"Failed to rename capturing groups in regex `{}` of \
174174
parameter `{}`: {}",
175175
re,
176176
parameter,

src/parse.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
use std::{fmt::Display, ops::RangeFrom};
2020

21-
use derive_more::{Display, Error};
21+
use derive_more::{Display as DeriveDisplay, Error as DeriveError};
2222
use nom::{
2323
branch::alt,
2424
bytes::complete::{tag, take_while, take_while1},
@@ -623,14 +623,14 @@ where
623623
}
624624

625625
/// Possible parsing errors.
626-
#[derive(Clone, Copy, Debug, Display, Error, Eq, PartialEq)]
626+
#[derive(Clone, Copy, Debug, DeriveDisplay, DeriveError, Eq, PartialEq)]
627627
pub enum Error<Input>
628628
where
629629
Input: Display,
630630
{
631631
/// Nested [`Parameter`]s.
632632
#[display(
633-
fmt = "{}\n\
633+
"{}\n\
634634
A parameter may not contain an other parameter.\n\
635635
If you did not mean to use an optional type you can use '\\{{' \
636636
to escape the '{{'. For more complicated expressions consider \
@@ -641,7 +641,7 @@ where
641641

642642
/// [`Optional`] inside a [`Parameter`].
643643
#[display(
644-
fmt = "{}\n\
644+
"{}\n\
645645
A parameter may not contain an optional.\n\
646646
If you did not mean to use an parameter type you can use '\\(' \
647647
to escape the '('.",
@@ -651,7 +651,7 @@ where
651651

652652
/// Unfinished [`Parameter`].
653653
#[display(
654-
fmt = "{}\n\
654+
"{}\n\
655655
The '{{' does not have a matching '}}'.\n\
656656
If you did not intend to use a parameter you can use '\\{{' to \
657657
escape the '{{'.",
@@ -661,7 +661,7 @@ where
661661

662662
/// Nested [`Optional`].
663663
#[display(
664-
fmt = "{}\n\
664+
"{}\n\
665665
An optional may not contain an other optional.\n\
666666
If you did not mean to use an optional type you can use '\\(' \
667667
to escape the '('. For more complicated expressions consider \
@@ -672,7 +672,7 @@ where
672672

673673
/// [`Parameter`] inside an [`Optional`].
674674
#[display(
675-
fmt = "{}\n\
675+
"{}\n\
676676
An optional may not contain a parameter.\n\
677677
If you did not mean to use an parameter type you can use \
678678
'\\{{' to escape the '{{'.",
@@ -682,7 +682,7 @@ where
682682

683683
/// Empty [`Optional`].
684684
#[display(
685-
fmt = "{}\n\
685+
"{}\n\
686686
An optional must contain some text.\n\
687687
If you did not mean to use an optional you can use '\\(' to \
688688
escape the '('.",
@@ -692,7 +692,7 @@ where
692692

693693
/// [`Alternation`] inside an [`Optional`].
694694
#[display(
695-
fmt = "{}\n\
695+
"{}\n\
696696
An alternation can not be used inside an optional.\n\
697697
You can use '\\/' to escape the '/'.",
698698
_0
@@ -701,7 +701,7 @@ where
701701

702702
/// Unfinished [`Optional`].
703703
#[display(
704-
fmt = "{}\n\
704+
"{}\n\
705705
The '(' does not have a matching ')'.\n\
706706
If you did not intend to use an optional you can use '\\(' to \
707707
escape the '('.",
@@ -711,7 +711,7 @@ where
711711

712712
/// Empty [`Alternation`].
713713
#[display(
714-
fmt = "{}\n\
714+
"{}\n\
715715
An alternation can not be empty.\n\
716716
If you did not mean to use an alternative you can use '\\/' to \
717717
escape the '/'.",
@@ -721,7 +721,7 @@ where
721721

722722
/// Only [`Optional`] inside [`Alternation`].
723723
#[display(
724-
fmt = "{}\n\
724+
"{}\n\
725725
An alternation may not exclusively contain optionals.\n\
726726
If you did not mean to use an optional you can use '\\(' to \
727727
escape the '('.",
@@ -731,7 +731,7 @@ where
731731

732732
/// Unescaped [`RESERVED_CHARS`].
733733
#[display(
734-
fmt = "{}\n\
734+
"{}\n\
735735
Unescaped reserved character.\n\
736736
You can use an '\\' to escape it.",
737737
_0
@@ -740,7 +740,7 @@ where
740740

741741
/// Escaped non-[`RESERVED_CHARS`].
742742
#[display(
743-
fmt = "{}\n\
743+
"{}\n\
744744
Only the characters '{{', '}}', '(', ')', '\\', '/' and \
745745
whitespace can be escaped.\n\
746746
If you did mean to use an '\\' you can use '\\\\' to escape it.",
@@ -750,7 +750,7 @@ where
750750

751751
/// Escaped EOL.
752752
#[display(
753-
fmt = "{}\n\
753+
"{}\n\
754754
The end of line can not be escaped.\n\
755755
You can use '\\' to escape the the '\'.",
756756
_0
@@ -759,15 +759,15 @@ where
759759

760760
/// Unknown error.
761761
#[display(
762-
fmt = "{}\n\
762+
"{}\n\
763763
Unknown parsing error.",
764764
_0
765765
)]
766766
Other(#[error(not(source))] Input, ErrorKind),
767767

768768
/// Parsing requires more data.
769769
#[display(
770-
fmt = "{}",
770+
"{}",
771771
"match _0 {\
772772
Needed::Size(n) => format!(\"Parsing requires {n} bytes/chars\"),\
773773
Needed::Unknown => \"Parsing requires more data\".to_owned(),\

0 commit comments

Comments
 (0)