File tree 1 file changed +16
-10
lines changed
1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -30,16 +30,22 @@ pub struct ExternalHtml{
30
30
impl ExternalHtml {
31
31
pub fn load ( in_header : & [ String ] , before_content : & [ String ] , after_content : & [ String ] )
32
32
-> Option < ExternalHtml > {
33
- match ( load_external_files ( in_header) ,
34
- load_external_files ( before_content) ,
35
- load_external_files ( after_content) ) {
36
- ( Some ( ih) , Some ( bc) , Some ( ac) ) => Some ( ExternalHtml {
37
- in_header : ih,
38
- before_content : bc,
39
- after_content : ac
40
- } ) ,
41
- _ => None
42
- }
33
+ load_external_files ( in_header)
34
+ . and_then ( |ih|
35
+ load_external_files ( before_content)
36
+ . map ( |bc| ( ih, bc) )
37
+ )
38
+ . and_then ( |( ih, bc) |
39
+ load_external_files ( after_content)
40
+ . map ( |ac| ( ih, bc, ac) )
41
+ )
42
+ . map ( |( ih, bc, ac) |
43
+ ExternalHtml {
44
+ in_header : ih,
45
+ before_content : bc,
46
+ after_content : ac,
47
+ }
48
+ )
43
49
}
44
50
}
45
51
You can’t perform that action at this time.
0 commit comments