Implement File::matches_with(&Regex)

This commit is contained in:
Matthias Beyer 2015-12-02 11:32:14 +01:00
parent 58bd36599f
commit d89977a09e

View file

@ -266,6 +266,10 @@ impl File {
self.id.clone() 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 { fn get_new_file_id() -> FileID {
use uuid::Uuid; use uuid::Uuid;
Uuid::new_v4().to_hyphenated_string() Uuid::new_v4().to_hyphenated_string()