1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
use crate::{Style, Svg, ViewBox};

pub trait ToSvgStr {
    fn to_svg_str(&self, style: &Style) -> String;
    fn viewbox(&self, style: &Style) -> ViewBox;
}

impl<'a> ToSvgStr for Svg<'a> {
    fn to_svg_str(&self, style: &Style) -> String {
        self.clone().with_style(style).to_string()
    }

    fn viewbox(&self, style: &Style) -> ViewBox {
        self.clone().with_style(style).viewbox
    }
}