-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add config option to exclude files form old_file_locs
- Loading branch information
Showing
7 changed files
with
91 additions
and
8 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
use regex::Regex; | ||
use serde::{Deserialize, Serialize}; | ||
use std::{ | ||
cmp::{Eq, PartialEq}, | ||
ops::Deref, | ||
}; | ||
|
||
/// Wrapper type for regex::Regex that only exists so we can implement Eq on it, as that's needed | ||
/// to put it in editor::Config | ||
#[derive(Debug, Clone, Serialize, Deserialize)] | ||
#[serde(transparent)] | ||
pub struct EqRegex { | ||
#[serde(with = "serde_regex")] | ||
inner: Regex, | ||
} | ||
|
||
impl From<Regex> for EqRegex { | ||
fn from(value: Regex) -> Self { | ||
EqRegex { inner: value } | ||
} | ||
} | ||
|
||
impl Deref for EqRegex { | ||
type Target = Regex; | ||
|
||
fn deref(&self) -> &Self::Target { | ||
&self.inner | ||
} | ||
} | ||
|
||
impl PartialEq for EqRegex { | ||
fn eq(&self, other: &Self) -> bool { | ||
self.as_str() == other.as_str() | ||
} | ||
} | ||
|
||
impl Eq for EqRegex {} |