@@ -3,8 +3,8 @@ use std::{fs::File, io::Write, path::Path};
33use dyn_clone:: DynClone ;
44use erased_serde:: Serialize as ErasedSerialize ;
55use rand:: {
6- distributions :: { Alphanumeric , DistString } ,
7- thread_rng ,
6+ distr :: { Alphanumeric , SampleString } ,
7+ rng ,
88} ;
99use rinja:: Template ;
1010use serde:: Serialize ;
@@ -254,7 +254,7 @@ impl Plot {
254254
255255 // Set up the temp file with a unique filename.
256256 let mut temp = env:: temp_dir ( ) ;
257- let mut plot_name = Alphanumeric . sample_string ( & mut thread_rng ( ) , 22 ) ;
257+ let mut plot_name = Alphanumeric . sample_string ( & mut rng ( ) , 22 ) ;
258258 plot_name. push_str ( ".html" ) ;
259259 plot_name = format ! ( "plotly_{}" , plot_name) ;
260260 temp. push ( plot_name) ;
@@ -296,7 +296,7 @@ impl Plot {
296296
297297 // Set up the temp file with a unique filename.
298298 let mut temp = env:: temp_dir ( ) ;
299- let mut plot_name = Alphanumeric . sample_string ( & mut thread_rng ( ) , 22 ) ;
299+ let mut plot_name = Alphanumeric . sample_string ( & mut rng ( ) , 22 ) ;
300300 plot_name. push_str ( ".html" ) ;
301301 plot_name = format ! ( "plotly_{}" , plot_name) ;
302302 temp. push ( plot_name) ;
@@ -354,13 +354,13 @@ impl Plot {
354354 pub fn to_inline_html ( & self , plot_div_id : Option < & str > ) -> String {
355355 let plot_div_id = match plot_div_id {
356356 Some ( id) => id. to_string ( ) ,
357- None => Alphanumeric . sample_string ( & mut thread_rng ( ) , 20 ) ,
357+ None => Alphanumeric . sample_string ( & mut rng ( ) , 20 ) ,
358358 } ;
359359 self . render_inline ( & plot_div_id)
360360 }
361361
362362 fn to_jupyter_notebook_html ( & self ) -> String {
363- let plot_div_id = Alphanumeric . sample_string ( & mut thread_rng ( ) , 20 ) ;
363+ let plot_div_id = Alphanumeric . sample_string ( & mut rng ( ) , 20 ) ;
364364
365365 let tmpl = JupyterNotebookPlotTemplate {
366366 plot : self ,
0 commit comments