1818
1919use std:: { fmt:: Display , ops:: RangeFrom } ;
2020
21- use derive_more:: { Display , Error } ;
21+ use derive_more:: { Display as DeriveDisplay , Error as DeriveError } ;
2222use 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 ) ]
627627pub enum Error < Input >
628628where
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