@@ -16,15 +16,10 @@ use syntax;
16
16
#[ derive( Debug ) ]
17
17
pub enum Error {
18
18
/// A syntax error.
19
- Syntax ( syntax :: Error ) ,
19
+ Syntax ( String ) ,
20
20
/// The compiled program exceeded the set size limit.
21
21
/// The argument is the size limit imposed.
22
22
CompiledTooBig ( usize ) ,
23
- /// **DEPRECATED:** Will be removed on next major version bump.
24
- ///
25
- /// This error is no longer used. (A `RegexSet` can now contain zero or
26
- /// more regular expressions.)
27
- InvalidSet ,
28
23
/// Hints that destructuring should not be exhaustive.
29
24
///
30
25
/// This enum may grow additional variants, so this makes sure clients
@@ -37,20 +32,14 @@ pub enum Error {
37
32
impl :: std:: error:: Error for Error {
38
33
fn description ( & self ) -> & str {
39
34
match * self {
40
- Error :: Syntax ( ref err) => err. description ( ) ,
35
+ Error :: Syntax ( ref err) => err,
41
36
Error :: CompiledTooBig ( _) => "compiled program too big" ,
42
- Error :: InvalidSet => {
43
- "sets must contain 2 or more regular expressions"
44
- }
45
37
Error :: __Nonexhaustive => unreachable ! ( ) ,
46
38
}
47
39
}
48
40
49
41
fn cause ( & self ) -> Option < & :: std:: error:: Error > {
50
- match * self {
51
- Error :: Syntax ( ref err) => Some ( err) ,
52
- _ => None ,
53
- }
42
+ None
54
43
}
55
44
}
56
45
@@ -62,16 +51,13 @@ impl fmt::Display for Error {
62
51
write ! ( f, "Compiled regex exceeds size limit of {} bytes." ,
63
52
limit)
64
53
}
65
- Error :: InvalidSet => {
66
- write ! ( f, "Sets must contain 2 or more regular expressions." )
67
- }
68
54
Error :: __Nonexhaustive => unreachable ! ( ) ,
69
55
}
70
56
}
71
57
}
72
58
73
59
impl From < syntax:: Error > for Error {
74
60
fn from ( err : syntax:: Error ) -> Error {
75
- Error :: Syntax ( err)
61
+ Error :: Syntax ( err. to_string ( ) )
76
62
}
77
63
}
0 commit comments