File tree 2 files changed +8
-15
lines changed
2 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -426,13 +426,13 @@ impl Plot {
426
426
height : usize ,
427
427
scale : f64 ,
428
428
) -> Result < String , String > {
429
- match format{
430
- ImageFormat :: JPEG => { } ,
431
- ImageFormat :: PNG => { } ,
432
- ImageFormat :: WEBP => { } ,
429
+ match format {
430
+ ImageFormat :: JPEG => { }
431
+ ImageFormat :: PNG => { }
432
+ ImageFormat :: WEBP => { }
433
433
_ => {
434
434
return Err ( "Format can only be JPEG, PNG, WEBP are allowed" . into ( ) ) ;
435
- } ,
435
+ }
436
436
}
437
437
let kaleido = plotly_kaleido:: Kaleido :: new ( ) ;
438
438
let output = kaleido
@@ -449,23 +449,17 @@ impl Plot {
449
449
450
450
// similar to write_image, but returns svg contents
451
451
#[ cfg( feature = "kaleido" ) ]
452
- pub fn to_svg (
453
- & self ,
454
- width : usize ,
455
- height : usize ,
456
- scale : f64 ,
457
- ) -> String {
452
+ pub fn to_svg ( & self , width : usize , height : usize , scale : f64 ) -> String {
458
453
let kaleido = plotly_kaleido:: Kaleido :: new ( ) ;
459
- let output = kaleido
454
+ kaleido
460
455
. get_image_data (
461
456
& serde_json:: to_value ( self ) . unwrap ( ) ,
462
457
"svg" ,
463
458
width,
464
459
height,
465
460
scale,
466
461
)
467
- . unwrap_or_else ( |_| panic ! ( "failed to generate b64" ) ) ;
468
- output
462
+ . unwrap_or_else ( |_| panic ! ( "failed to generate b64" ) )
469
463
}
470
464
471
465
fn render ( & self ) -> String {
Original file line number Diff line number Diff line change @@ -190,7 +190,6 @@ impl Kaleido {
190
190
height : usize ,
191
191
scale : f64 ,
192
192
) -> Result < String , Box < dyn std:: error:: Error > > {
193
-
194
193
let p = self . cmd_path . as_path ( ) ;
195
194
let p = p. to_str ( ) . unwrap ( ) ;
196
195
let p = String :: from ( p) ;
You can’t perform that action at this time.
0 commit comments