diff options
Diffstat (limited to 'src/traits.rs')
-rw-r--r-- | src/traits.rs | 13 |
1 files changed, 0 insertions, 13 deletions
diff --git a/src/traits.rs b/src/traits.rs deleted file mode 100644 index db1b2eb..0000000 --- a/src/traits.rs +++ /dev/null | |||
@@ -1,13 +0,0 @@ | |||
1 | use super::regex::Regex; | ||
2 | |||
3 | #[derive(Debug)] | ||
4 | pub struct Trait { | ||
5 | name: String, | ||
6 | value: String, | ||
7 | } | ||
8 | |||
9 | pub fn parse(s: &str) -> Vec<Trait> { | ||
10 | let reg_trait = Regex::new(r#"(?is)<dt.*?>(.*?)</dt>.*?<dd>(.*?)</dd>"#).unwrap(); | ||
11 | |||
12 | reg_trait.captures_iter(s).map(|c| Trait { name: c.at(1).unwrap().into(), value: c.at(2).unwrap().into() }).collect() | ||
13 | } | ||