We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 714a59a commit 53cda8aCopy full SHA for 53cda8a
plotters/src/evcxr.rs
@@ -51,9 +51,9 @@ pub fn evcxr_bitmap_figure<
51
size: (u32, u32),
52
draw: Draw,
53
) -> SVGWrapper {
54
- let pixel_size = 3;
+ const PIXEL_SIZE : usize = 3;
55
let mut buf = Vec::new();
56
- buf.resize((size.0 as usize) * (size.1 as usize) * pixel_size, 0);
+ buf.resize((size.0 as usize) * (size.1 as usize) * PIXEL_SIZE, 0);
57
let root = BitMapBackend::with_buffer(&mut buf, size).into_drawing_area();
58
draw(root).expect("Drawing failure");
59
let mut buffer = "".to_string();
@@ -63,5 +63,5 @@ pub fn evcxr_bitmap_figure<
63
.blit_bitmap((0, 0), size, &buf)
64
.expect("Failure converting to SVG");
65
}
66
- SVGWrapper(buffer.clone(), "".to_string())
+ SVGWrapper(buffer, "".to_string())
67
0 commit comments