File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ use crate::{Configuration, Layout};
1515#[ template( path = "plot.html" , escape = "none" ) ]
1616struct PlotTemplate < ' a > {
1717 plot : & ' a Plot ,
18- js_scripts : String ,
18+ js_scripts : & ' a str ,
1919}
2020
2121#[ derive( Template ) ]
@@ -24,7 +24,7 @@ struct PlotTemplate<'a> {
2424struct StaticPlotTemplate < ' a > {
2525 plot : & ' a Plot ,
2626 format : ImageFormat ,
27- js_scripts : String ,
27+ js_scripts : & ' a str ,
2828 width : usize ,
2929 height : usize ,
3030}
@@ -466,7 +466,7 @@ impl Plot {
466466 fn render ( & self ) -> String {
467467 let tmpl = PlotTemplate {
468468 plot : self ,
469- js_scripts : self . js_scripts . clone ( ) ,
469+ js_scripts : & self . js_scripts ,
470470 } ;
471471 tmpl. render ( ) . unwrap ( )
472472 }
@@ -476,7 +476,7 @@ impl Plot {
476476 let tmpl = StaticPlotTemplate {
477477 plot : self ,
478478 format,
479- js_scripts : self . js_scripts . clone ( ) ,
479+ js_scripts : & self . js_scripts ,
480480 width,
481481 height,
482482 } ;
You can’t perform that action at this time.
0 commit comments