Skip to content

Commit 2b7e297

Browse files
mchantandrei-ng
authored andcommitted
fixed clippy error
1 parent 0259d0c commit 2b7e297

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

Diff for: plotly/src/plot.rs

+8-14
Original file line numberDiff line numberDiff line change
@@ -426,13 +426,13 @@ impl Plot {
426426
height: usize,
427427
scale: f64,
428428
) -> 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 => {}
433433
_ => {
434434
return Err("Format can only be JPEG, PNG, WEBP are allowed".into());
435-
},
435+
}
436436
}
437437
let kaleido = plotly_kaleido::Kaleido::new();
438438
let output = kaleido
@@ -449,23 +449,17 @@ impl Plot {
449449

450450
// similar to write_image, but returns svg contents
451451
#[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 {
458453
let kaleido = plotly_kaleido::Kaleido::new();
459-
let output = kaleido
454+
kaleido
460455
.get_image_data(
461456
&serde_json::to_value(self).unwrap(),
462457
"svg",
463458
width,
464459
height,
465460
scale,
466461
)
467-
.unwrap_or_else(|_| panic!("failed to generate b64"));
468-
output
462+
.unwrap_or_else(|_| panic!("failed to generate b64"))
469463
}
470464

471465
fn render(&self) -> String {

Diff for: plotly_kaleido/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ impl Kaleido {
190190
height: usize,
191191
scale: f64,
192192
) -> Result<String, Box<dyn std::error::Error>> {
193-
194193
let p = self.cmd_path.as_path();
195194
let p = p.to_str().unwrap();
196195
let p = String::from(p);

0 commit comments

Comments
 (0)