rust/hg-core/src/lib.rs
changeset 44529 52d40f8fb82d
parent 44348 d8d4fa9a7f18
child 44534 483fce658e43
equal deleted inserted replaced
44528:b2e41723f886 44529:52d40f8fb82d
   124     TooLong(usize),
   124     TooLong(usize),
   125     IO(std::io::Error),
   125     IO(std::io::Error),
   126     /// Needed a pattern that can be turned into a regex but got one that
   126     /// Needed a pattern that can be turned into a regex but got one that
   127     /// can't. This should only happen through programmer error.
   127     /// can't. This should only happen through programmer error.
   128     NonRegexPattern(IgnorePattern),
   128     NonRegexPattern(IgnorePattern),
       
   129     /// This is temporary, see `re2/mod.rs`.
       
   130     /// This will cause a fallback to Python.
       
   131     Re2NotInstalled,
   129 }
   132 }
   130 
   133 
   131 impl ToString for PatternError {
   134 impl ToString for PatternError {
   132     fn to_string(&self) -> String {
   135     fn to_string(&self) -> String {
   133         match self {
   136         match self {
   145             }
   148             }
   146             PatternError::IO(e) => e.to_string(),
   149             PatternError::IO(e) => e.to_string(),
   147             PatternError::Path(e) => e.to_string(),
   150             PatternError::Path(e) => e.to_string(),
   148             PatternError::NonRegexPattern(pattern) => {
   151             PatternError::NonRegexPattern(pattern) => {
   149                 format!("'{:?}' cannot be turned into a regex", pattern)
   152                 format!("'{:?}' cannot be turned into a regex", pattern)
       
   153             }
       
   154             PatternError::Re2NotInstalled => {
       
   155                 "Re2 is not installed, cannot use regex functionality."
       
   156                     .to_string()
   150             }
   157             }
   151         }
   158         }
   152     }
   159     }
   153 }
   160 }
   154 
   161