Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated Error::description #633

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
38 changes: 1 addition & 37 deletions regex-syntax/src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,43 +175,7 @@ pub enum ErrorKind {
__Nonexhaustive,
}

impl error::Error for Error {
fn description(&self) -> &str {
use self::ErrorKind::*;
match self.kind {
CaptureLimitExceeded => "capture group limit exceeded",
ClassEscapeInvalid => "invalid escape sequence in character class",
ClassRangeInvalid => "invalid character class range",
ClassRangeLiteral => "invalid range boundary, must be a literal",
ClassUnclosed => "unclosed character class",
DecimalEmpty => "empty decimal literal",
DecimalInvalid => "invalid decimal literal",
EscapeHexEmpty => "empty hexadecimal literal",
EscapeHexInvalid => "invalid hexadecimal literal",
EscapeHexInvalidDigit => "invalid hexadecimal digit",
EscapeUnexpectedEof => "unexpected eof (escape sequence)",
EscapeUnrecognized => "unrecognized escape sequence",
FlagDanglingNegation => "dangling flag negation operator",
FlagDuplicate { .. } => "duplicate flag",
FlagRepeatedNegation { .. } => "repeated negation",
FlagUnexpectedEof => "unexpected eof (flag)",
FlagUnrecognized => "unrecognized flag",
GroupNameDuplicate { .. } => "duplicate capture group name",
GroupNameEmpty => "empty capture group name",
GroupNameInvalid => "invalid capture group name",
GroupNameUnexpectedEof => "unclosed capture group name",
GroupUnclosed => "unclosed group",
GroupUnopened => "unopened group",
NestLimitExceeded(_) => "nest limit exceeded",
RepetitionCountInvalid => "invalid repetition count range",
RepetitionCountUnclosed => "unclosed counted repetition",
RepetitionMissing => "repetition operator missing expression",
UnsupportedBackreference => "backreferences are not supported",
UnsupportedLookAround => "look-around is not supported",
_ => unreachable!(),
}
}
}
impl error::Error for Error {}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down
10 changes: 1 addition & 9 deletions regex-syntax/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,7 @@ impl From<hir::Error> for Error {
}
}

impl error::Error for Error {
fn description(&self) -> &str {
match *self {
Error::Parse(ref x) => x.description(),
Error::Translate(ref x) => x.description(),
_ => unreachable!(),
}
}
}
impl error::Error for Error {}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down
6 changes: 1 addition & 5 deletions regex-syntax/src/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,7 @@ impl ErrorKind {
}
}

impl error::Error for Error {
fn description(&self) -> &str {
self.kind.description()
}
}
impl error::Error for Error {}

impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down
17 changes: 4 additions & 13 deletions regex-syntax/src/unicode_tables/property_bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8203,12 +8203,8 @@ pub const OTHER_GRAPHEME_EXTEND: &'static [(char, char)] = &[
pub const OTHER_ID_CONTINUE: &'static [(char, char)] =
&[('·', '·'), ('·', '·'), ('፩', '፱'), ('᧚', '᧚')];

pub const OTHER_ID_START: &'static [(char, char)] = &[
('\u{1885}', '\u{1886}'),
('℘', '℘'),
('℮', '℮'),
('゛', '゜'),
];
pub const OTHER_ID_START: &'static [(char, char)] =
&[('\u{1885}', '\u{1886}'), ('℘', '℘'), ('℮', '℮'), ('゛', '゜')];

pub const OTHER_LOWERCASE: &'static [(char, char)] = &[
('ª', 'ª'),
Expand Down Expand Up @@ -8370,13 +8366,8 @@ pub const OTHER_MATH: &'static [(char, char)] = &[
('𞺫', '𞺻'),
];

pub const OTHER_UPPERCASE: &'static [(char, char)] = &[
('Ⅰ', 'Ⅿ'),
('Ⓐ', 'Ⓩ'),
('🄰', '🅉'),
('🅐', '🅩'),
('🅰', '🆉'),
];
pub const OTHER_UPPERCASE: &'static [(char, char)] =
&[('Ⅰ', 'Ⅿ'), ('Ⓐ', 'Ⓩ'), ('🄰', '🅉'), ('🅐', '🅩'), ('🅰', '🆉')];

pub const PATTERN_SYNTAX: &'static [(char, char)] = &[
('!', '/'),
Expand Down
Loading