Skip to content

Commit 53cda8a

Browse files
committed
Remove unncessary clone
1 parent 714a59a commit 53cda8a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

plotters/src/evcxr.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@ pub fn evcxr_bitmap_figure<
5151
size: (u32, u32),
5252
draw: Draw,
5353
) -> SVGWrapper {
54-
let pixel_size = 3;
54+
const PIXEL_SIZE : usize = 3;
5555
let mut buf = Vec::new();
56-
buf.resize((size.0 as usize) * (size.1 as usize) * pixel_size, 0);
56+
buf.resize((size.0 as usize) * (size.1 as usize) * PIXEL_SIZE, 0);
5757
let root = BitMapBackend::with_buffer(&mut buf, size).into_drawing_area();
5858
draw(root).expect("Drawing failure");
5959
let mut buffer = "".to_string();
@@ -63,5 +63,5 @@ pub fn evcxr_bitmap_figure<
6363
.blit_bitmap((0, 0), size, &buf)
6464
.expect("Failure converting to SVG");
6565
}
66-
SVGWrapper(buffer.clone(), "".to_string())
66+
SVGWrapper(buffer, "".to_string())
6767
}

0 commit comments

Comments
 (0)