cleanup
This commit is contained in:
parent
b90e557a3d
commit
2eb9b5d3c7
1 changed files with 4 additions and 4 deletions
|
@ -51,7 +51,6 @@ fn process_children(children: &Vec<Item>) -> String {
|
|||
|
||||
|
||||
fn has_image(children: &Vec<Item>) -> bool {
|
||||
let mut result = false;
|
||||
for c in children {
|
||||
match c {
|
||||
Item::Image(_) => {
|
||||
|
@ -60,11 +59,10 @@ fn has_image(children: &Vec<Item>) -> bool {
|
|||
_ => {}
|
||||
}
|
||||
}
|
||||
result
|
||||
false
|
||||
}
|
||||
|
||||
fn has_video(children: &Vec<Item>) -> bool{
|
||||
let mut result = false;
|
||||
for c in children {
|
||||
match c {
|
||||
Item::Video(_) => {
|
||||
|
@ -227,7 +225,6 @@ enum Item {
|
|||
//text, links, formatting are all markdown
|
||||
//arguably, for better control it will be best to turn markdown into its own set of items
|
||||
Image(String),
|
||||
Svg(String),// wont' support for a while I think.
|
||||
Video(Vec<Item>),
|
||||
Audio(Vec<Item>),
|
||||
Source(String),
|
||||
|
@ -303,6 +300,9 @@ fn parse_items(n: ego_tree::NodeRef<'_,Node>) -> Item{
|
|||
"video" => {
|
||||
return Item::Video(get_children(&el))
|
||||
}
|
||||
"audio" => {
|
||||
return Item::Audio(get_children(&el))
|
||||
}
|
||||
"ol" => {
|
||||
return Item::OrderedList(get_children(&el))
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue