Implement File::matches_with(&Regex)

This commit is contained in:
Matthias Beyer 2015-12-02 11:32:14 +01:00
parent 58bd36599f
commit d89977a09e
1 changed files with 4 additions and 0 deletions

View File

@ -266,6 +266,10 @@ impl File {
self.id.clone()
}
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()