Add File::matches_with(&Regex)

This commit is contained in:
Matthias Beyer 2015-11-30 19:50:24 +01:00
parent e598a475e5
commit 103cba0c27

View file

@ -285,6 +285,10 @@ impl<'a> File<'a> {
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 {
use uuid::Uuid;
Uuid::new_v4().to_hyphenated_string()