Skip to content

Commit

Permalink
Added 'static
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucretiel committed Aug 18, 2020
1 parent 91bce27 commit 65590f9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/parsing/regex.rs
Expand Up @@ -32,7 +32,7 @@ impl Regex {
}

/// Check whether the pattern compiles as a valid regex or not.
pub fn try_compile(regex_str: &str) -> Option<Box<dyn Error + Send + Sync>> {
pub fn try_compile(regex_str: &str) -> Option<Box<dyn Error + Send + Sync + 'static>> {
regex_impl::Regex::new(regex_str).err()
}

Expand Down Expand Up @@ -142,7 +142,7 @@ mod regex_impl {
}

impl Regex {
pub fn new(regex_str: &str) -> Result<Regex, Box<dyn Error + Send + Sync>> {
pub fn new(regex_str: &str) -> Result<Regex, Box<dyn Error + Send + Sync + 'static>> {
let result = onig::Regex::with_options(
regex_str,
RegexOptions::REGEX_OPTION_CAPTURE_GROUP,
Expand Down Expand Up @@ -210,7 +210,7 @@ mod regex_impl {
}

impl Regex {
pub fn new(regex_str: &str) -> Result<Regex, Box<dyn Error + Send + Sync>> {
pub fn new(regex_str: &str) -> Result<Regex, Box<dyn Error + Send + Sync + 'static>> {
let result = fancy_regex::Regex::new(regex_str);
match result {
Ok(regex) => Ok(Regex { regex }),
Expand Down
2 changes: 1 addition & 1 deletion src/parsing/yaml_load.rs
Expand Up @@ -18,7 +18,7 @@ pub enum ParseSyntaxError {
/// Some keys are required for something to be a valid `.sublime-syntax`
MissingMandatoryKey(&'static str),
/// Invalid regex
RegexCompileError(String, Box<dyn Error + Send + Sync>),
RegexCompileError(String, Box<dyn Error + Send + Sync + 'static>),
/// A scope that syntect's scope implementation can't handle
InvalidScope(ParseScopeError),
/// A reference to another file that is invalid
Expand Down

0 comments on commit 65590f9

Please sign in to comment.