File tree Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -609,7 +609,7 @@ impl BaseDocument {
609
609
match kind {
610
610
ImageType :: Image => {
611
611
node. element_data_mut ( ) . unwrap ( ) . node_specific_data =
612
- NodeSpecificData :: Image ( Box :: new ( ImageData :: Svg ( * tree) ) ) ;
612
+ NodeSpecificData :: Image ( Box :: new ( ImageData :: Svg ( tree) ) ) ;
613
613
614
614
// Clear layout cache
615
615
node. cache . clear ( ) ;
@@ -620,7 +620,7 @@ impl BaseDocument {
620
620
. and_then ( |el| el. background_images . get_mut ( idx) )
621
621
{
622
622
bg_image. status = Status :: Ok ;
623
- bg_image. image = ImageData :: Svg ( * tree) ;
623
+ bg_image. image = ImageData :: Svg ( tree) ;
624
624
}
625
625
}
626
626
}
Original file line number Diff line number Diff line change @@ -83,8 +83,6 @@ pub(crate) fn collect_layout_children(
83
83
84
84
#[ cfg( feature = "svg" ) ]
85
85
if matches ! ( tag_name, "svg" ) {
86
- use crate :: node:: ImageData ;
87
-
88
86
let mut outer_html = doc. get_node ( container_node_id) . unwrap ( ) . outer_html ( ) ;
89
87
90
88
// HACK: usvg fails to parse SVGs that don't have the SVG xmlns set. So inject it
@@ -100,8 +98,7 @@ pub(crate) fn collect_layout_children(
100
98
. unwrap ( )
101
99
. element_data_mut ( )
102
100
. unwrap ( )
103
- . node_specific_data =
104
- NodeSpecificData :: Image ( Box :: new ( ImageData :: Svg ( svg) ) ) ;
101
+ . node_specific_data = NodeSpecificData :: Image ( Box :: new ( svg. into ( ) ) ) ;
105
102
}
106
103
Err ( err) => {
107
104
println ! ( "{} SVG parse failed" , container_node_id) ;
Original file line number Diff line number Diff line change @@ -559,7 +559,7 @@ impl RasterImageData {
559
559
pub enum ImageData {
560
560
Raster ( RasterImageData ) ,
561
561
#[ cfg( feature = "svg" ) ]
562
- Svg ( usvg:: Tree ) ,
562
+ Svg ( Box < usvg:: Tree > ) ,
563
563
None ,
564
564
}
565
565
impl From < Arc < DynamicImage > > for ImageData {
@@ -570,7 +570,7 @@ impl From<Arc<DynamicImage>> for ImageData {
570
570
#[ cfg( feature = "svg" ) ]
571
571
impl From < usvg:: Tree > for ImageData {
572
572
fn from ( value : usvg:: Tree ) -> Self {
573
- Self :: Svg ( value)
573
+ Self :: Svg ( Box :: new ( value) )
574
574
}
575
575
}
576
576
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ pub struct ActiveRenderState {
27
27
surface : RenderSurface < ' static > ,
28
28
}
29
29
30
+ #[ allow( clippy:: large_enum_variant) ]
30
31
pub enum RenderState {
31
32
Active ( ActiveRenderState ) ,
32
33
Suspended ,
You can’t perform that action at this time.
0 commit comments