diff options
author | jan <jan@ruken.pw> | 2016-10-09 09:28:08 (UTC) |
---|---|---|
committer | jan <jan@ruken.pw> | 2016-10-09 09:28:08 (UTC) |
commit | 6d7a31be9c6fd413d407334c40d02c008b7334ec (patch) | |
tree | b9e73e5651d2dc1d72833875ab37469b7f2c1b53 /src/dl_list.rs | |
parent | 54c2cb1e484e09b4fcfe236aff70c01bf3bbaae0 (diff) |
fixierung
Diffstat (limited to 'src/dl_list.rs')
-rw-r--r-- | src/dl_list.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/dl_list.rs b/src/dl_list.rs index 3327388..17d49fc 100644 --- a/src/dl_list.rs +++ b/src/dl_list.rs | |||
@@ -9,5 +9,12 @@ pub struct DLListItem { | |||
9 | pub fn parse(s: &str) -> Vec<DLListItem> { | 9 | pub fn parse(s: &str) -> Vec<DLListItem> { |
10 | let reg_list_item = Regex::new(r#"(?is)<dt.*?>(.*?)</dt>.*?<dd>(.*?)</dd>"#).unwrap(); | 10 | let reg_list_item = Regex::new(r#"(?is)<dt.*?>(.*?)</dt>.*?<dd>(.*?)</dd>"#).unwrap(); |
11 | 11 | ||
12 | reg_list_item.captures_iter(s).map(|c| DLListItem { name: c.at(1).unwrap().into(), value: c.at(2).unwrap().into() }).collect() | 12 | reg_list_item.captures_iter(s) |
13 | .map(|c| { | ||
14 | DLListItem { | ||
15 | name: c.at(1).unwrap().into(), | ||
16 | value: c.at(2).unwrap().into(), | ||
17 | } | ||
18 | }) | ||
19 | .collect() | ||
13 | } | 20 | } |