Add File::matches_with(&Regex)
This commit is contained in:
parent
e598a475e5
commit
103cba0c27
1 changed files with 4 additions and 0 deletions
|
@ -285,6 +285,10 @@ impl<'a> File<'a> {
|
||||||
self.owning_module
|
self.owning_module
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn matches_with(&self, r: &Regex) -> bool {
|
||||||
|
r.is_match(&self.data[..]) || self.header.matches_with(r)
|
||||||
|
}
|
||||||
|
|
||||||
fn get_new_file_id() -> FileID {
|
fn get_new_file_id() -> FileID {
|
||||||
use uuid::Uuid;
|
use uuid::Uuid;
|
||||||
Uuid::new_v4().to_hyphenated_string()
|
Uuid::new_v4().to_hyphenated_string()
|
||||||
|
|
Loading…
Reference in a new issue