diff --git a/regex-syntax/src/ast/mod.rs b/regex-syntax/src/ast/mod.rs index 6cd0bc48f4..d73eda16dd 100644 --- a/regex-syntax/src/ast/mod.rs +++ b/regex-syntax/src/ast/mod.rs @@ -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 { diff --git a/regex-syntax/src/error.rs b/regex-syntax/src/error.rs index 464148e3dd..5d2e832c52 100644 --- a/regex-syntax/src/error.rs +++ b/regex-syntax/src/error.rs @@ -39,15 +39,7 @@ impl From 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 { diff --git a/regex-syntax/src/hir/mod.rs b/regex-syntax/src/hir/mod.rs index ee08e83dba..0c4705f87b 100644 --- a/regex-syntax/src/hir/mod.rs +++ b/regex-syntax/src/hir/mod.rs @@ -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 { diff --git a/regex-syntax/src/unicode_tables/property_bool.rs b/regex-syntax/src/unicode_tables/property_bool.rs index 59713a882e..efe6eb369d 100644 --- a/regex-syntax/src/unicode_tables/property_bool.rs +++ b/regex-syntax/src/unicode_tables/property_bool.rs @@ -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)] = &[ ('ª', 'ª'), @@ -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)] = &[ ('!', '/'), diff --git a/regex-syntax/src/unicode_tables/script.rs b/regex-syntax/src/unicode_tables/script.rs index 12ddf0167f..19dbc38e56 100644 --- a/regex-syntax/src/unicode_tables/script.rs +++ b/regex-syntax/src/unicode_tables/script.rs @@ -230,11 +230,9 @@ pub const ARABIC: &'static [(char, char)] = &[ pub const ARMENIAN: &'static [(char, char)] = &[('Ա', 'Ֆ'), ('ՙ', 'ֈ'), ('֊', '֊'), ('֍', '֏'), ('ﬓ', 'ﬗ')]; -pub const AVESTAN: &'static [(char, char)] = - &[('𐬀', '𐬵'), ('𐬹', '𐬿')]; +pub const AVESTAN: &'static [(char, char)] = &[('𐬀', '𐬵'), ('𐬹', '𐬿')]; -pub const BALINESE: &'static [(char, char)] = - &[('\u{1b00}', 'ᭋ'), ('᭐', '᭼')]; +pub const BALINESE: &'static [(char, char)] = &[('\u{1b00}', 'ᭋ'), ('᭐', '᭼')]; pub const BAMUM: &'static [(char, char)] = &[('ꚠ', '꛷'), ('𖠀', '𖨸')]; @@ -260,12 +258,8 @@ pub const BENGALI: &'static [(char, char)] = &[ ('০', '\u{9fe}'), ]; -pub const BHAIKSUKI: &'static [(char, char)] = &[ - ('𑰀', '𑰈'), - ('𑰊', '\u{11c36}'), - ('\u{11c38}', '𑱅'), - ('𑱐', '𑱬'), -]; +pub const BHAIKSUKI: &'static [(char, char)] = + &[('𑰀', '𑰈'), ('𑰊', '\u{11c36}'), ('\u{11c38}', '𑱅'), ('𑱐', '𑱬')]; pub const BOPOMOFO: &'static [(char, char)] = &[('˪', '˫'), ('ㄅ', 'ㄯ'), ('ㆠ', 'ㆺ')]; @@ -275,8 +269,7 @@ pub const BRAHMI: &'static [(char, char)] = pub const BRAILLE: &'static [(char, char)] = &[('⠀', '⣿')]; -pub const BUGINESE: &'static [(char, char)] = - &[('ᨀ', '\u{1a1b}'), ('᨞', '᨟')]; +pub const BUGINESE: &'static [(char, char)] = &[('ᨀ', '\u{1a1b}'), ('᨞', '᨟')]; pub const BUHID: &'static [(char, char)] = &[('ᝀ', '\u{1753}')]; @@ -478,14 +471,8 @@ pub const COPTIC: &'static [(char, char)] = pub const CUNEIFORM: &'static [(char, char)] = &[('𒀀', '𒎙'), ('𒐀', '𒑮'), ('𒑰', '𒑴'), ('𒒀', '𒕃')]; -pub const CYPRIOT: &'static [(char, char)] = &[ - ('𐠀', '𐠅'), - ('𐠈', '𐠈'), - ('𐠊', '𐠵'), - ('𐠷', '𐠸'), - ('𐠼', '𐠼'), - ('𐠿', '𐠿'), -]; +pub const CYPRIOT: &'static [(char, char)] = + &[('𐠀', '𐠅'), ('𐠈', '𐠈'), ('𐠊', '𐠵'), ('𐠷', '𐠸'), ('𐠼', '𐠼'), ('𐠿', '𐠿')]; pub const CYRILLIC: &'static [(char, char)] = &[ ('Ѐ', '\u{484}'), @@ -509,13 +496,8 @@ pub const DEVANAGARI: &'static [(char, char)] = &[ pub const DOGRA: &'static [(char, char)] = &[('𑠀', '𑠻')]; -pub const DUPLOYAN: &'static [(char, char)] = &[ - ('𛰀', '𛱪'), - ('𛱰', '𛱼'), - ('𛲀', '𛲈'), - ('𛲐', '𛲙'), - ('𛲜', '𛲟'), -]; +pub const DUPLOYAN: &'static [(char, char)] = + &[('𛰀', '𛱪'), ('𛱰', '𛱼'), ('𛲀', '𛲈'), ('𛲐', '𛲙'), ('𛲜', '𛲟')]; pub const EGYPTIAN_HIEROGLYPHS: &'static [(char, char)] = &[('𓀀', '𓐮'), ('\u{13430}', '\u{13438}')]; @@ -825,8 +807,7 @@ pub const KATAKANA: &'static [(char, char)] = &[ ('\u{1b164}', '\u{1b167}'), ]; -pub const KAYAH_LI: &'static [(char, char)] = - &[('꤀', '\u{a92d}'), ('꤯', '꤯')]; +pub const KAYAH_LI: &'static [(char, char)] = &[('꤀', '\u{a92d}'), ('꤯', '꤯')]; pub const KHAROSHTHI: &'static [(char, char)] = &[ ('𐨀', '\u{10a03}'), @@ -842,8 +823,7 @@ pub const KHAROSHTHI: &'static [(char, char)] = &[ pub const KHMER: &'static [(char, char)] = &[('ក', '\u{17dd}'), ('០', '៩'), ('៰', '៹'), ('᧠', '᧿')]; -pub const KHOJKI: &'static [(char, char)] = - &[('𑈀', '𑈑'), ('𑈓', '\u{1123e}')]; +pub const KHOJKI: &'static [(char, char)] = &[('𑈀', '𑈑'), ('𑈓', '\u{1123e}')]; pub const KHUDAWADI: &'static [(char, char)] = &[('𑊰', '\u{112ea}'), ('𑋰', '𑋹')]; @@ -925,8 +905,7 @@ pub const LISU: &'static [(char, char)] = &[('ꓐ', '꓿')]; pub const LYCIAN: &'static [(char, char)] = &[('𐊀', '𐊜')]; -pub const LYDIAN: &'static [(char, char)] = - &[('𐤠', '𐤹'), ('𐤿', '𐤿')]; +pub const LYDIAN: &'static [(char, char)] = &[('𐤠', '𐤹'), ('𐤿', '𐤿')]; pub const MAHAJANI: &'static [(char, char)] = &[('𑅐', '𑅶')]; @@ -943,8 +922,7 @@ pub const MALAYALAM: &'static [(char, char)] = &[ ('൦', 'ൿ'), ]; -pub const MANDAIC: &'static [(char, char)] = - &[('ࡀ', '\u{85b}'), ('࡞', '࡞')]; +pub const MANDAIC: &'static [(char, char)] = &[('ࡀ', '\u{85b}'), ('࡞', '࡞')]; pub const MANICHAEAN: &'static [(char, char)] = &[('𐫀', '\u{10ae6}'), ('𐫫', '𐫶')]; @@ -975,14 +953,10 @@ pub const MEROITIC_CURSIVE: &'static [(char, char)] = pub const MEROITIC_HIEROGLYPHS: &'static [(char, char)] = &[('𐦀', '𐦟')]; -pub const MIAO: &'static [(char, char)] = &[ - ('𖼀', '\u{16f4a}'), - ('\u{16f4f}', '\u{16f87}'), - ('\u{16f8f}', '𖾟'), -]; +pub const MIAO: &'static [(char, char)] = + &[('𖼀', '\u{16f4a}'), ('\u{16f4f}', '\u{16f87}'), ('\u{16f8f}', '𖾟')]; -pub const MODI: &'static [(char, char)] = - &[('𑘀', '𑙄'), ('𑙐', '𑙙')]; +pub const MODI: &'static [(char, char)] = &[('𑘀', '𑙄'), ('𑙐', '𑙙')]; pub const MONGOLIAN: &'static [(char, char)] = &[ ('᠀', '᠁'), @@ -994,22 +968,15 @@ pub const MONGOLIAN: &'static [(char, char)] = &[ ('𑙠', '𑙬'), ]; -pub const MRO: &'static [(char, char)] = - &[('𖩀', '𖩞'), ('𖩠', '𖩩'), ('𖩮', '𖩯')]; +pub const MRO: &'static [(char, char)] = &[('𖩀', '𖩞'), ('𖩠', '𖩩'), ('𖩮', '𖩯')]; -pub const MULTANI: &'static [(char, char)] = &[ - ('𑊀', '𑊆'), - ('𑊈', '𑊈'), - ('𑊊', '𑊍'), - ('𑊏', '𑊝'), - ('𑊟', '𑊩'), -]; +pub const MULTANI: &'static [(char, char)] = + &[('𑊀', '𑊆'), ('𑊈', '𑊈'), ('𑊊', '𑊍'), ('𑊏', '𑊝'), ('𑊟', '𑊩')]; pub const MYANMAR: &'static [(char, char)] = &[('က', '႟'), ('ꧠ', 'ꧾ'), ('ꩠ', 'ꩿ')]; -pub const NABATAEAN: &'static [(char, char)] = - &[('𐢀', '𐢞'), ('𐢧', '𐢯')]; +pub const NABATAEAN: &'static [(char, char)] = &[('𐢀', '𐢞'), ('𐢧', '𐢯')]; pub const NANDINAGARI: &'static [(char, char)] = &[ ('\u{119a0}', '\u{119a7}'), @@ -1025,8 +992,7 @@ pub const NEWA: &'static [(char, char)] = pub const NKO: &'static [(char, char)] = &[('߀', 'ߺ'), ('\u{7fd}', '߿')]; -pub const NUSHU: &'static [(char, char)] = - &[('𖿡', '𖿡'), ('𛅰', '𛋻')]; +pub const NUSHU: &'static [(char, char)] = &[('𖿡', '𖿡'), ('𛅰', '𛋻')]; pub const NYIAKENG_PUACHUE_HMONG: &'static [(char, char)] = &[ ('\u{1e100}', '\u{1e12c}'), @@ -1042,15 +1008,13 @@ pub const OL_CHIKI: &'static [(char, char)] = &[('᱐', '᱿')]; pub const OLD_HUNGARIAN: &'static [(char, char)] = &[('𐲀', '𐲲'), ('𐳀', '𐳲'), ('𐳺', '𐳿')]; -pub const OLD_ITALIC: &'static [(char, char)] = - &[('𐌀', '𐌣'), ('𐌭', '𐌯')]; +pub const OLD_ITALIC: &'static [(char, char)] = &[('𐌀', '𐌣'), ('𐌭', '𐌯')]; pub const OLD_NORTH_ARABIAN: &'static [(char, char)] = &[('𐪀', '𐪟')]; pub const OLD_PERMIC: &'static [(char, char)] = &[('𐍐', '\u{1037a}')]; -pub const OLD_PERSIAN: &'static [(char, char)] = - &[('𐎠', '𐏃'), ('𐏈', '𐏕')]; +pub const OLD_PERSIAN: &'static [(char, char)] = &[('𐎠', '𐏃'), ('𐏈', '𐏕')]; pub const OLD_SOGDIAN: &'static [(char, char)] = &[('𐼀', '𐼧')]; @@ -1075,19 +1039,12 @@ pub const ORIYA: &'static [(char, char)] = &[ ('୦', '୷'), ]; -pub const OSAGE: &'static [(char, char)] = - &[('𐒰', '𐓓'), ('𐓘', '𐓻')]; +pub const OSAGE: &'static [(char, char)] = &[('𐒰', '𐓓'), ('𐓘', '𐓻')]; -pub const OSMANYA: &'static [(char, char)] = - &[('𐒀', '𐒝'), ('𐒠', '𐒩')]; +pub const OSMANYA: &'static [(char, char)] = &[('𐒀', '𐒝'), ('𐒠', '𐒩')]; -pub const PAHAWH_HMONG: &'static [(char, char)] = &[ - ('𖬀', '𖭅'), - ('𖭐', '𖭙'), - ('𖭛', '𖭡'), - ('𖭣', '𖭷'), - ('𖭽', '𖮏'), -]; +pub const PAHAWH_HMONG: &'static [(char, char)] = + &[('𖬀', '𖭅'), ('𖭐', '𖭙'), ('𖭛', '𖭡'), ('𖭣', '𖭷'), ('𖭽', '𖮏')]; pub const PALMYRENE: &'static [(char, char)] = &[('𐡠', '𐡿')]; @@ -1095,8 +1052,7 @@ pub const PAU_CIN_HAU: &'static [(char, char)] = &[('𑫀', '𑫸')]; pub const PHAGS_PA: &'static [(char, char)] = &[('ꡀ', '꡷')]; -pub const PHOENICIAN: &'static [(char, char)] = - &[('𐤀', '𐤛'), ('𐤟', '𐤟')]; +pub const PHOENICIAN: &'static [(char, char)] = &[('𐤀', '𐤛'), ('𐤟', '𐤟')]; pub const PSALTER_PAHLAVI: &'static [(char, char)] = &[('𐮀', '𐮑'), ('𐮙', '𐮜'), ('𐮩', '𐮯')]; @@ -1105,25 +1061,20 @@ pub const REJANG: &'static [(char, char)] = &[('ꤰ', '꥓'), ('꥟', '꥟')]; pub const RUNIC: &'static [(char, char)] = &[('ᚠ', 'ᛪ'), ('ᛮ', 'ᛸ')]; -pub const SAMARITAN: &'static [(char, char)] = - &[('ࠀ', '\u{82d}'), ('࠰', '࠾')]; +pub const SAMARITAN: &'static [(char, char)] = &[('ࠀ', '\u{82d}'), ('࠰', '࠾')]; pub const SAURASHTRA: &'static [(char, char)] = &[('ꢀ', '\u{a8c5}'), ('꣎', '꣙')]; -pub const SHARADA: &'static [(char, char)] = - &[('\u{11180}', '𑇍'), ('𑇐', '𑇟')]; +pub const SHARADA: &'static [(char, char)] = &[('\u{11180}', '𑇍'), ('𑇐', '𑇟')]; pub const SHAVIAN: &'static [(char, char)] = &[('𐑐', '𐑿')]; pub const SIDDHAM: &'static [(char, char)] = &[('𑖀', '\u{115b5}'), ('𑖸', '\u{115dd}')]; -pub const SIGNWRITING: &'static [(char, char)] = &[ - ('𝠀', '𝪋'), - ('\u{1da9b}', '\u{1da9f}'), - ('\u{1daa1}', '\u{1daaf}'), -]; +pub const SIGNWRITING: &'static [(char, char)] = + &[('𝠀', '𝪋'), ('\u{1da9b}', '\u{1da9f}'), ('\u{1daa1}', '\u{1daaf}')]; pub const SINHALA: &'static [(char, char)] = &[ ('ං', 'ඃ'), @@ -1143,8 +1094,7 @@ pub const SINHALA: &'static [(char, char)] = &[ pub const SOGDIAN: &'static [(char, char)] = &[('𐼰', '𐽙')]; -pub const SORA_SOMPENG: &'static [(char, char)] = - &[('𑃐', '𑃨'), ('𑃰', '𑃹')]; +pub const SORA_SOMPENG: &'static [(char, char)] = &[('𑃐', '𑃨'), ('𑃰', '𑃹')]; pub const SOYOMBO: &'static [(char, char)] = &[('𑩐', '𑪢')]; @@ -1156,8 +1106,7 @@ pub const SYLOTI_NAGRI: &'static [(char, char)] = &[('ꠀ', '꠫')]; pub const SYRIAC: &'static [(char, char)] = &[('܀', '܍'), ('\u{70f}', '\u{74a}'), ('ݍ', 'ݏ'), ('ࡠ', 'ࡪ')]; -pub const TAGALOG: &'static [(char, char)] = - &[('ᜀ', 'ᜌ'), ('ᜎ', '\u{1714}')]; +pub const TAGALOG: &'static [(char, char)] = &[('ᜀ', 'ᜌ'), ('ᜎ', '\u{1714}')]; pub const TAGBANWA: &'static [(char, char)] = &[('ᝠ', 'ᝬ'), ('ᝮ', 'ᝰ'), ('\u{1772}', '\u{1773}')]; @@ -1172,11 +1121,9 @@ pub const TAI_THAM: &'static [(char, char)] = &[ ('᪠', '᪭'), ]; -pub const TAI_VIET: &'static [(char, char)] = - &[('ꪀ', 'ꫂ'), ('ꫛ', '꫟')]; +pub const TAI_VIET: &'static [(char, char)] = &[('ꪀ', 'ꫂ'), ('ꫛ', '꫟')]; -pub const TAKRI: &'static [(char, char)] = - &[('𑚀', '\u{116b8}'), ('𑛀', '𑛉')]; +pub const TAKRI: &'static [(char, char)] = &[('𑚀', '\u{116b8}'), ('𑛀', '𑛉')]; pub const TAMIL: &'static [(char, char)] = &[ ('\u{b82}', 'ஃ'), @@ -1219,8 +1166,7 @@ pub const TELUGU: &'static [(char, char)] = &[ pub const THAANA: &'static [(char, char)] = &[('ހ', 'ޱ')]; -pub const THAI: &'static [(char, char)] = - &[('ก', '\u{e3a}'), ('เ', '๛')]; +pub const THAI: &'static [(char, char)] = &[('ก', '\u{e3a}'), ('เ', '๛')]; pub const TIBETAN: &'static [(char, char)] = &[ ('ༀ', 'ཇ'), @@ -1235,19 +1181,16 @@ pub const TIBETAN: &'static [(char, char)] = &[ pub const TIFINAGH: &'static [(char, char)] = &[('ⴰ', 'ⵧ'), ('ⵯ', '⵰'), ('\u{2d7f}', '\u{2d7f}')]; -pub const TIRHUTA: &'static [(char, char)] = - &[('𑒀', '𑓇'), ('𑓐', '𑓙')]; +pub const TIRHUTA: &'static [(char, char)] = &[('𑒀', '𑓇'), ('𑓐', '𑓙')]; -pub const UGARITIC: &'static [(char, char)] = - &[('𐎀', '𐎝'), ('𐎟', '𐎟')]; +pub const UGARITIC: &'static [(char, char)] = &[('𐎀', '𐎝'), ('𐎟', '𐎟')]; pub const VAI: &'static [(char, char)] = &[('ꔀ', 'ꘫ')]; pub const WANCHO: &'static [(char, char)] = &[('\u{1e2c0}', '\u{1e2f9}'), ('\u{1e2ff}', '\u{1e2ff}')]; -pub const WARANG_CITI: &'static [(char, char)] = - &[('𑢠', '𑣲'), ('𑣿', '𑣿')]; +pub const WARANG_CITI: &'static [(char, char)] = &[('𑢠', '𑣲'), ('𑣿', '𑣿')]; pub const YI: &'static [(char, char)] = &[('ꀀ', 'ꒌ'), ('꒐', '꓆')]; diff --git a/regex-syntax/src/unicode_tables/script_extension.rs b/regex-syntax/src/unicode_tables/script_extension.rs index a86b17eb22..aa3894e575 100644 --- a/regex-syntax/src/unicode_tables/script_extension.rs +++ b/regex-syntax/src/unicode_tables/script_extension.rs @@ -225,11 +225,9 @@ pub const ARABIC: &'static [(char, char)] = &[ pub const ARMENIAN: &'static [(char, char)] = &[('Ա', 'Ֆ'), ('ՙ', '֊'), ('֍', '֏'), ('ﬓ', 'ﬗ')]; -pub const AVESTAN: &'static [(char, char)] = - &[('𐬀', '𐬵'), ('𐬹', '𐬿')]; +pub const AVESTAN: &'static [(char, char)] = &[('𐬀', '𐬵'), ('𐬹', '𐬿')]; -pub const BALINESE: &'static [(char, char)] = - &[('\u{1b00}', 'ᭋ'), ('᭐', '᭼')]; +pub const BALINESE: &'static [(char, char)] = &[('\u{1b00}', 'ᭋ'), ('᭐', '᭼')]; pub const BAMUM: &'static [(char, char)] = &[('ꚠ', '꛷'), ('𖠀', '𖨸')]; @@ -267,12 +265,8 @@ pub const BENGALI: &'static [(char, char)] = &[ ('\u{a8f1}', '\u{a8f1}'), ]; -pub const BHAIKSUKI: &'static [(char, char)] = &[ - ('𑰀', '𑰈'), - ('𑰊', '\u{11c36}'), - ('\u{11c38}', '𑱅'), - ('𑱐', '𑱬'), -]; +pub const BHAIKSUKI: &'static [(char, char)] = + &[('𑰀', '𑰈'), ('𑰊', '\u{11c36}'), ('\u{11c38}', '𑱅'), ('𑱐', '𑱬')]; pub const BOPOMOFO: &'static [(char, char)] = &[ ('˪', '˫'), @@ -297,8 +291,7 @@ pub const BRAILLE: &'static [(char, char)] = &[('⠀', '⣿')]; pub const BUGINESE: &'static [(char, char)] = &[('ᨀ', '\u{1a1b}'), ('᨞', '᨟'), ('ꧏ', 'ꧏ')]; -pub const BUHID: &'static [(char, char)] = - &[('᜵', '᜶'), ('ᝀ', '\u{1753}')]; +pub const BUHID: &'static [(char, char)] = &[('᜵', '᜶'), ('ᝀ', '\u{1753}')]; pub const CANADIAN_ABORIGINAL: &'static [(char, char)] = &[('᐀', 'ᙿ'), ('ᢰ', 'ᣵ')]; @@ -308,12 +301,8 @@ pub const CARIAN: &'static [(char, char)] = &[('𐊠', '𐋐')]; pub const CAUCASIAN_ALBANIAN: &'static [(char, char)] = &[('𐔰', '𐕣'), ('𐕯', '𐕯')]; -pub const CHAKMA: &'static [(char, char)] = &[ - ('০', '৯'), - ('၀', '၉'), - ('\u{11100}', '\u{11134}'), - ('𑄶', '𑅆'), -]; +pub const CHAKMA: &'static [(char, char)] = + &[('০', '৯'), ('၀', '၉'), ('\u{11100}', '\u{11134}'), ('𑄶', '𑅆')]; pub const CHAM: &'static [(char, char)] = &[('ꨀ', '\u{aa36}'), ('ꩀ', 'ꩍ'), ('꩐', '꩙'), ('꩜', '꩟')]; @@ -514,13 +503,8 @@ pub const DEVANAGARI: &'static [(char, char)] = &[ pub const DOGRA: &'static [(char, char)] = &[('।', '९'), ('꠰', '꠹'), ('𑠀', '𑠻')]; -pub const DUPLOYAN: &'static [(char, char)] = &[ - ('𛰀', '𛱪'), - ('𛱰', '𛱼'), - ('𛲀', '𛲈'), - ('𛲐', '𛲙'), - ('𛲜', '\u{1bca3}'), -]; +pub const DUPLOYAN: &'static [(char, char)] = + &[('𛰀', '𛱪'), ('𛱰', '𛱼'), ('𛲀', '𛲈'), ('𛲐', '𛲙'), ('𛲜', '\u{1bca3}')]; pub const EGYPTIAN_HIEROGLYPHS: &'static [(char, char)] = &[('𓀀', '𓐮'), ('\u{13430}', '\u{13438}')]; @@ -852,12 +836,8 @@ pub const INSCRIPTIONAL_PARTHIAN: &'static [(char, char)] = pub const JAVANESE: &'static [(char, char)] = &[('\u{a980}', '꧍'), ('ꧏ', '꧙'), ('꧞', '꧟')]; -pub const KAITHI: &'static [(char, char)] = &[ - ('०', '९'), - ('꠰', '꠹'), - ('\u{11080}', '𑃁'), - ('\u{110cd}', '\u{110cd}'), -]; +pub const KAITHI: &'static [(char, char)] = + &[('०', '९'), ('꠰', '꠹'), ('\u{11080}', '𑃁'), ('\u{110cd}', '\u{110cd}')]; pub const KANNADA: &'static [(char, char)] = &[ ('\u{951}', '\u{952}'), @@ -1011,8 +991,7 @@ pub const LISU: &'static [(char, char)] = &[('ꓐ', '꓿')]; pub const LYCIAN: &'static [(char, char)] = &[('𐊀', '𐊜')]; -pub const LYDIAN: &'static [(char, char)] = - &[('𐤠', '𐤹'), ('𐤿', '𐤿')]; +pub const LYDIAN: &'static [(char, char)] = &[('𐤠', '𐤹'), ('𐤿', '𐤿')]; pub const MAHAJANI: &'static [(char, char)] = &[('।', '९'), ('꠰', '꠹'), ('𑅐', '𑅶')]; @@ -1067,11 +1046,8 @@ pub const MEROITIC_CURSIVE: &'static [(char, char)] = pub const MEROITIC_HIEROGLYPHS: &'static [(char, char)] = &[('𐦀', '𐦟')]; -pub const MIAO: &'static [(char, char)] = &[ - ('𖼀', '\u{16f4a}'), - ('\u{16f4f}', '\u{16f87}'), - ('\u{16f8f}', '𖾟'), -]; +pub const MIAO: &'static [(char, char)] = + &[('𖼀', '\u{16f4a}'), ('\u{16f4f}', '\u{16f87}'), ('\u{16f8f}', '𖾟')]; pub const MODI: &'static [(char, char)] = &[('꠰', '꠹'), ('𑘀', '𑙄'), ('𑙐', '𑙙')]; @@ -1085,23 +1061,15 @@ pub const MONGOLIAN: &'static [(char, char)] = &[ ('𑙠', '𑙬'), ]; -pub const MRO: &'static [(char, char)] = - &[('𖩀', '𖩞'), ('𖩠', '𖩩'), ('𖩮', '𖩯')]; +pub const MRO: &'static [(char, char)] = &[('𖩀', '𖩞'), ('𖩠', '𖩩'), ('𖩮', '𖩯')]; -pub const MULTANI: &'static [(char, char)] = &[ - ('੦', '੯'), - ('𑊀', '𑊆'), - ('𑊈', '𑊈'), - ('𑊊', '𑊍'), - ('𑊏', '𑊝'), - ('𑊟', '𑊩'), -]; +pub const MULTANI: &'static [(char, char)] = + &[('੦', '੯'), ('𑊀', '𑊆'), ('𑊈', '𑊈'), ('𑊊', '𑊍'), ('𑊏', '𑊝'), ('𑊟', '𑊩')]; pub const MYANMAR: &'static [(char, char)] = &[('က', '႟'), ('꤮', '꤮'), ('ꧠ', 'ꧾ'), ('ꩠ', 'ꩿ')]; -pub const NABATAEAN: &'static [(char, char)] = - &[('𐢀', '𐢞'), ('𐢧', '𐢯')]; +pub const NABATAEAN: &'static [(char, char)] = &[('𐢀', '𐢞'), ('𐢧', '𐢯')]; pub const NANDINAGARI: &'static [(char, char)] = &[ ('।', '॥'), @@ -1123,8 +1091,7 @@ pub const NEWA: &'static [(char, char)] = pub const NKO: &'static [(char, char)] = &[('߀', 'ߺ'), ('\u{7fd}', '߿')]; -pub const NUSHU: &'static [(char, char)] = - &[('𖿡', '𖿡'), ('𛅰', '𛋻')]; +pub const NUSHU: &'static [(char, char)] = &[('𖿡', '𖿡'), ('𛅰', '𛋻')]; pub const NYIAKENG_PUACHUE_HMONG: &'static [(char, char)] = &[ ('\u{1e100}', '\u{1e12c}'), @@ -1140,16 +1107,14 @@ pub const OL_CHIKI: &'static [(char, char)] = &[('᱐', '᱿')]; pub const OLD_HUNGARIAN: &'static [(char, char)] = &[('𐲀', '𐲲'), ('𐳀', '𐳲'), ('𐳺', '𐳿')]; -pub const OLD_ITALIC: &'static [(char, char)] = - &[('𐌀', '𐌣'), ('𐌭', '𐌯')]; +pub const OLD_ITALIC: &'static [(char, char)] = &[('𐌀', '𐌣'), ('𐌭', '𐌯')]; pub const OLD_NORTH_ARABIAN: &'static [(char, char)] = &[('𐪀', '𐪟')]; pub const OLD_PERMIC: &'static [(char, char)] = &[('\u{483}', '\u{483}'), ('𐍐', '\u{1037a}')]; -pub const OLD_PERSIAN: &'static [(char, char)] = - &[('𐎠', '𐏃'), ('𐏈', '𐏕')]; +pub const OLD_PERSIAN: &'static [(char, char)] = &[('𐎠', '𐏃'), ('𐏈', '𐏕')]; pub const OLD_SOGDIAN: &'static [(char, char)] = &[('𐼀', '𐼧')]; @@ -1178,19 +1143,12 @@ pub const ORIYA: &'static [(char, char)] = &[ ('ᳲ', 'ᳲ'), ]; -pub const OSAGE: &'static [(char, char)] = - &[('𐒰', '𐓓'), ('𐓘', '𐓻')]; +pub const OSAGE: &'static [(char, char)] = &[('𐒰', '𐓓'), ('𐓘', '𐓻')]; -pub const OSMANYA: &'static [(char, char)] = - &[('𐒀', '𐒝'), ('𐒠', '𐒩')]; +pub const OSMANYA: &'static [(char, char)] = &[('𐒀', '𐒝'), ('𐒠', '𐒩')]; -pub const PAHAWH_HMONG: &'static [(char, char)] = &[ - ('𖬀', '𖭅'), - ('𖭐', '𖭙'), - ('𖭛', '𖭡'), - ('𖭣', '𖭷'), - ('𖭽', '𖮏'), -]; +pub const PAHAWH_HMONG: &'static [(char, char)] = + &[('𖬀', '𖭅'), ('𖭐', '𖭙'), ('𖭛', '𖭡'), ('𖭣', '𖭷'), ('𖭽', '𖮏')]; pub const PALMYRENE: &'static [(char, char)] = &[('𐡠', '𐡿')]; @@ -1199,8 +1157,7 @@ pub const PAU_CIN_HAU: &'static [(char, char)] = &[('𑫀', '𑫸')]; pub const PHAGS_PA: &'static [(char, char)] = &[('᠂', '᠃'), ('᠅', '᠅'), ('ꡀ', '꡷')]; -pub const PHOENICIAN: &'static [(char, char)] = - &[('𐤀', '𐤛'), ('𐤟', '𐤟')]; +pub const PHOENICIAN: &'static [(char, char)] = &[('𐤀', '𐤛'), ('𐤟', '𐤟')]; pub const PSALTER_PAHLAVI: &'static [(char, char)] = &[('ـ', 'ـ'), ('𐮀', '𐮑'), ('𐮙', '𐮜'), ('𐮩', '𐮯')]; @@ -1209,8 +1166,7 @@ pub const REJANG: &'static [(char, char)] = &[('ꤰ', '꥓'), ('꥟', '꥟')]; pub const RUNIC: &'static [(char, char)] = &[('ᚠ', 'ᛪ'), ('ᛮ', 'ᛸ')]; -pub const SAMARITAN: &'static [(char, char)] = - &[('ࠀ', '\u{82d}'), ('࠰', '࠾')]; +pub const SAMARITAN: &'static [(char, char)] = &[('ࠀ', '\u{82d}'), ('࠰', '࠾')]; pub const SAURASHTRA: &'static [(char, char)] = &[('ꢀ', '\u{a8c5}'), ('꣎', '꣙')]; @@ -1230,11 +1186,8 @@ pub const SHAVIAN: &'static [(char, char)] = &[('𐑐', '𐑿')]; pub const SIDDHAM: &'static [(char, char)] = &[('𑖀', '\u{115b5}'), ('𑖸', '\u{115dd}')]; -pub const SIGNWRITING: &'static [(char, char)] = &[ - ('𝠀', '𝪋'), - ('\u{1da9b}', '\u{1da9f}'), - ('\u{1daa1}', '\u{1daaf}'), -]; +pub const SIGNWRITING: &'static [(char, char)] = + &[('𝠀', '𝪋'), ('\u{1da9b}', '\u{1da9f}'), ('\u{1daa1}', '\u{1daaf}')]; pub const SINHALA: &'static [(char, char)] = &[ ('।', '॥'), @@ -1255,8 +1208,7 @@ pub const SINHALA: &'static [(char, char)] = &[ pub const SOGDIAN: &'static [(char, char)] = &[('ـ', 'ـ'), ('𐼰', '𐽙')]; -pub const SORA_SOMPENG: &'static [(char, char)] = - &[('𑃐', '𑃨'), ('𑃰', '𑃹')]; +pub const SORA_SOMPENG: &'static [(char, char)] = &[('𑃐', '𑃨'), ('𑃰', '𑃹')]; pub const SOYOMBO: &'static [(char, char)] = &[('𑩐', '𑪢')]; @@ -1282,12 +1234,8 @@ pub const SYRIAC: &'static [(char, char)] = &[ pub const TAGALOG: &'static [(char, char)] = &[('ᜀ', 'ᜌ'), ('ᜎ', '\u{1714}'), ('᜵', '᜶')]; -pub const TAGBANWA: &'static [(char, char)] = &[ - ('᜵', '᜶'), - ('ᝠ', 'ᝬ'), - ('ᝮ', 'ᝰ'), - ('\u{1772}', '\u{1773}'), -]; +pub const TAGBANWA: &'static [(char, char)] = + &[('᜵', '᜶'), ('ᝠ', 'ᝬ'), ('ᝮ', 'ᝰ'), ('\u{1772}', '\u{1773}')]; pub const TAI_LE: &'static [(char, char)] = &[('၀', '၉'), ('ᥐ', 'ᥭ'), ('ᥰ', 'ᥴ')]; @@ -1300,8 +1248,7 @@ pub const TAI_THAM: &'static [(char, char)] = &[ ('᪠', '᪭'), ]; -pub const TAI_VIET: &'static [(char, char)] = - &[('ꪀ', 'ꫂ'), ('ꫛ', '꫟')]; +pub const TAI_VIET: &'static [(char, char)] = &[('ꪀ', 'ꫂ'), ('ꫛ', '꫟')]; pub const TAKRI: &'static [(char, char)] = &[('।', '॥'), ('꠰', '꠹'), ('𑚀', '\u{116b8}'), ('𑛀', '𑛉')]; @@ -1366,8 +1313,7 @@ pub const THAANA: &'static [(char, char)] = &[ ('﷽', '﷽'), ]; -pub const THAI: &'static [(char, char)] = - &[('ก', '\u{e3a}'), ('เ', '๛')]; +pub const THAI: &'static [(char, char)] = &[('ก', '\u{e3a}'), ('เ', '๛')]; pub const TIBETAN: &'static [(char, char)] = &[ ('ༀ', 'ཇ'), @@ -1391,16 +1337,14 @@ pub const TIRHUTA: &'static [(char, char)] = &[ ('𑓐', '𑓙'), ]; -pub const UGARITIC: &'static [(char, char)] = - &[('𐎀', '𐎝'), ('𐎟', '𐎟')]; +pub const UGARITIC: &'static [(char, char)] = &[('𐎀', '𐎝'), ('𐎟', '𐎟')]; pub const VAI: &'static [(char, char)] = &[('ꔀ', 'ꘫ')]; pub const WANCHO: &'static [(char, char)] = &[('\u{1e2c0}', '\u{1e2f9}'), ('\u{1e2ff}', '\u{1e2ff}')]; -pub const WARANG_CITI: &'static [(char, char)] = - &[('𑢠', '𑣲'), ('𑣿', '𑣿')]; +pub const WARANG_CITI: &'static [(char, char)] = &[('𑢠', '𑣲'), ('𑣿', '𑣿')]; pub const YI: &'static [(char, char)] = &[ ('、', '。'), diff --git a/src/error.rs b/src/error.rs index eb7f121a83..23d4b342a3 100644 --- a/src/error.rs +++ b/src/error.rs @@ -18,15 +18,7 @@ pub enum Error { __Nonexhaustive, } -impl ::std::error::Error for Error { - fn description(&self) -> &str { - match *self { - Error::Syntax(ref err) => err, - Error::CompiledTooBig(_) => "compiled program too big", - Error::__Nonexhaustive => unreachable!(), - } - } -} +impl ::std::error::Error for Error {} impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { diff --git a/tests/bytes.rs b/tests/bytes.rs index 6c5a11ac77..d05f138edf 100644 --- a/tests/bytes.rs +++ b/tests/bytes.rs @@ -69,10 +69,12 @@ matiter!( R(b"\x8d#;\x1a\xa4s3\x05foobarX\\\x0f0t\xe4\x9b\xa4"), (0, 0) ); -matiter!(invalidutf8_anchor2, - r"(?-u)^\xf7|4\xff\d\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a##########[] d\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a##########\[] #####\x80\S7|$", - R(b"\x8d#;\x1a\xa4s3\x05foobarX\\\x0f0t\xe4\x9b\xa4"), - (22, 22)); +matiter!( + invalidutf8_anchor2, + r"(?-u)^\xf7|4\xff\d\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a##########[] d\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a\x8a##########\[] #####\x80\S7|$", + R(b"\x8d#;\x1a\xa4s3\x05foobarX\\\x0f0t\xe4\x9b\xa4"), + (22, 22) +); matiter!( invalidutf8_anchor3, r"(?-u)^|ddp\xff\xffdddddlQd@\x80", diff --git a/tests/consistent.rs b/tests/consistent.rs index 2d7bdcf8d1..0f9ea53f35 100644 --- a/tests/consistent.rs +++ b/tests/consistent.rs @@ -231,7 +231,6 @@ macro_rules! checker { TestResult::from_bool(true) } } - } // mod }; // rule case } // macro_rules! diff --git a/tests/crazy.rs b/tests/crazy.rs index 20a3371b2e..8c72273d93 100644 --- a/tests/crazy.rs +++ b/tests/crazy.rs @@ -29,8 +29,12 @@ mat!( "mine is jam.slam@gmail ", None ); -mat!(match_email_big, r"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", - "mine is jam.slam@gmail.com ", Some((8, 26))); +mat!( + match_email_big, + r"[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?", + "mine is jam.slam@gmail.com ", + Some((8, 26)) +); mat!( match_date1, r"(?-u)^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$", diff --git a/tests/fowler.rs b/tests/fowler.rs index 5da32935e7..7f56a758d3 100644 --- a/tests/fowler.rs +++ b/tests/fowler.rs @@ -215,7 +215,13 @@ mat!( Some((1, 2)), Some((1, 2)) ); -mat!(match_basic_76, r"a?(ab|ba)*", r"ababababababababababababababababababababababababababababababababababababababababa", Some((0, 81)), Some((79, 81))); +mat!( + match_basic_76, + r"a?(ab|ba)*", + r"ababababababababababababababababababababababababababababababababababababababababa", + Some((0, 81)), + Some((79, 81)) +); mat!( match_basic_77, r"abaa|abbaa|abbbaa|abbbbaa", diff --git a/tests/unicode.rs b/tests/unicode.rs index 597f86873a..52522f41c6 100644 --- a/tests/unicode.rs +++ b/tests/unicode.rs @@ -60,12 +60,7 @@ mat!( "〰", Some((0, 3)) ); -mat!( - uni_class_gencat_decimal_numer, - r"\p{Decimal_Number}", - "𑓙", - Some((0, 4)) -); +mat!(uni_class_gencat_decimal_numer, r"\p{Decimal_Number}", "𑓙", Some((0, 4))); mat!( uni_class_gencat_enclosing_mark, r"\p{Enclosing_Mark}", @@ -86,12 +81,7 @@ mat!( Some((0, 3)) ); mat!(uni_class_gencat_letter, r"\p{Letter}", "Έ", Some((0, 2))); -mat!( - uni_class_gencat_letter_number, - r"\p{Letter_Number}", - "ↂ", - Some((0, 3)) -); +mat!(uni_class_gencat_letter_number, r"\p{Letter_Number}", "ↂ", Some((0, 3))); mat!( uni_class_gencat_line_separator, r"\p{Line_Separator}",