Skip to content

Commit 10367ec

Browse files
committed
Prepare for the 0.3.2 release
1 parent ba2315c commit 10367ec

File tree

25 files changed

+89
-66
lines changed

25 files changed

+89
-66
lines changed

CHANGELOG.md

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,23 @@
11
# Changelog
22

3-
## Plotters latest (?)
3+
## Plotters 0.3.3 (?)
4+
5+
## Plotters 0.3.2 (2022-07-05)
46

57
### Added
68

7-
- Pie element (by hhamana)
9+
- Pie element (by @hhamana)
810

911
### Improved
1012

11-
- Improved documentaiton for predefined colors. (Thanks to siefkenj)
12-
- Introduce the full Material Design 2014 Color Palette. (Thanks to siefkenj)
13+
- Improved documentaiton for predefined colors. (Thanks to @siefkenj)
14+
- Introduce the full Material Design 2014 Color Palette. (Thanks to @siefkenj)
15+
- Massive documentation improvements (Thanks to @facorread and many others)
16+
17+
### Fixed
18+
19+
- More float point axis key point algorithm fixes (@38)
20+
- Default rasterizer fixes (@shinmili and @38)
1321

1422
## Plotters 0.3.1 (2021-05-21)
1523

@@ -26,6 +34,7 @@
2634
- Examples that uses old APIs (thanks to chrisduerr)
2735

2836
## Plotters 0.3.0 (2020-09-03)
37+
2938
This is the next major release of Plotters, see [release notes](./RELEASE-NOTES.md) for more detials.
3039

3140
### Added
@@ -44,26 +53,28 @@ This is the next major release of Plotters, see [release notes](./RELEASE-NOTES.
4453
### Improvement
4554

4655
- Enhanced key point algorithms: New key point hint trait are used for key point algorithms && many improvment on key point algorithms for different types
47-
- Renamed `MeshStyle::line\_style\_1\ and `MeshStyle::line\_style\_2` to `bold\_line\_style` and `light\_line\_style`
48-
- Reorganize the "plotters::coord" namespace
56+
- Renamed `MeshStyle::line\_style\_1` and `MeshStyle::line\_style\_2` to `bold\_line\_style` and `light\_line\_style`
57+
- Reorganize the "plotters::coord" namespace
4958
- Improved discrete coordinate trait
5059
- Split backend code into isolated crates and can be maintained indepdendenly
5160
- Category coordinate is now replaced by slice coordinate
52-
- Removing the requirement for `Debug` trait for chart coordinate, allows ranged coordinate define its own formatting function.
61+
- Removing the requirement for `Debug` trait for chart coordinate, allows ranged coordinate define its own formatting function.
5362

5463
### Removed
5564

5665
- The `Path` name alias for `PathElement`
57-
- Most code `plotters::drawing::backend\_impl::\* ` (expect `MockedBackend` for testing purpose) is removed due to crate split.
66+
- Most code `plotters::drawing::backend\_impl::\*` (expect `MockedBackend` for testing purpose) is removed due to crate split.
5867
- Piston backend due to the Piston project seems not actively developing
5968

6069
## Plotters 0.2.15 (2020-05-26)
70+
6171
### Fixed
6272

6373
- Division by zero with logarithmic coord (issue #143)
6474
- Update dependencies
6575

6676
## Plotters 0.2.14 (2020-05-05)
77+
6778
### Fixed
6879

6980
- Compile error with older rustc which causing breaks

doc-template/latest_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.3.1
1+
0.3.2

plotters-backend/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ pub trait DrawingBackend: Sized {
174174
for end in path.into_iter() {
175175
if let Some(begin) = begin {
176176
let result = self.draw_line(begin, end, style);
177+
#[allow(clippy::question_mark)]
177178
if result.is_err() {
178179
return result;
179180
}
@@ -290,11 +291,11 @@ pub trait DrawingBackend: Sized {
290291
/// TODO: The default implementation of bitmap blitting assumes that the bitmap is RGB, but
291292
/// this may not be the case. But for bitmap backend it's actually ok if we use the bitmap
292293
/// element that matches the pixel format, but we need to fix this.
293-
fn blit_bitmap<'a>(
294+
fn blit_bitmap(
294295
&mut self,
295296
pos: BackendCoord,
296297
(iw, ih): (u32, u32),
297-
src: &'a [u8],
298+
src: &[u8],
298299
) -> Result<(), DrawingErrorKind<Self::ErrorType>> {
299300
let (w, h) = self.get_size();
300301

@@ -315,6 +316,7 @@ pub trait DrawingBackend: Sized {
315316
rgb: (r, g, b),
316317
};
317318
let result = self.draw_pixel((pos.0 + dx as i32, pos.1 + dy as i32), color);
319+
#[allow(clippy::question_mark)]
318320
if result.is_err() {
319321
return result;
320322
}

plotters-backend/src/rasterizer/line.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ pub fn draw_line<DB: DrawingBackend, S: BackendStyle>(
109109
y += grad;
110110
}
111111

112-
if to.0 >= batch_limit + 1 && y < f64::from(to.1) {
112+
if to.0 > batch_limit && y < f64::from(to.1) {
113113
let x = batch_limit as i32 + 1;
114114
if 1.0 + y.floor() - y > 1e-5 {
115115
check_result!(put_pixel((x, y as i32), 1.0 + y.floor() - y));

plotters-backend/src/rasterizer/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,19 @@
66
77
*/
88

9-
// TODO: ? operator is very slow. See issue #58 for details
9+
// TODO: We need to revisit this. It has been a long time since last time we figured out
10+
// the question mark operator has a huge performance impact due to LLVM unable to handle it.
11+
// So the question is if this trick is still useful, or LLVM is smart enough to handle it since
12+
// then.
13+
//
14+
// --
15+
// Original comment:
16+
//
17+
// ? operator is very slow. See issue #58 for details
1018
macro_rules! check_result {
1119
($e:expr) => {
1220
let result = $e;
21+
#[allow(clippy::question_mark)]
1322
if result.is_err() {
1423
return result;
1524
}

plotters-backend/src/rasterizer/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ fn traverse_vertices<'a>(
122122
recent.swap(1, 2);
123123
recent[2] = *p;
124124
compute_polygon_vertex(&recent, f64::from(width) / 2.0, &mut vertex_buf);
125-
vertex_buf.iter().cloned().for_each(|v| op(v));
125+
vertex_buf.iter().cloned().for_each(&mut op);
126126
}
127127

128128
let b = recent[1];

plotters-backend/src/text.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ pub trait BackendTextStyle {
241241

242242
fn family(&self) -> FontFamily;
243243

244+
#[allow(clippy::type_complexity)]
244245
fn layout_box(&self, text: &str) -> Result<((i32, i32), (i32, i32)), Self::FontError>;
245246

246247
fn draw<E, DrawFunc: FnMut(i32, i32, BackendColor) -> Result<(), E>>(

plotters-bitmap/src/bitmap.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,11 @@ impl<'a, P: PixelFormat> DrawingBackend for BitMapBackend<'a, P> {
289289
plotters_backend::rasterizer::draw_rect(self, upper_left, bottom_right, style, fill)
290290
}
291291

292-
fn blit_bitmap<'b>(
292+
fn blit_bitmap(
293293
&mut self,
294294
pos: BackendCoord,
295295
(sw, sh): (u32, u32),
296-
src: &'b [u8],
296+
src: &[u8],
297297
) -> Result<(), DrawingErrorKind<Self::ErrorType>> {
298298
let (dw, dh) = self.get_size();
299299

plotters-svg/src/svg.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl Target<'_> {
4545
}
4646

4747
enum SVGTag {
48-
SVG,
48+
Svg,
4949
Circle,
5050
Line,
5151
Polygon,
@@ -59,7 +59,7 @@ enum SVGTag {
5959
impl SVGTag {
6060
fn to_tag_name(&self) -> &'static str {
6161
match self {
62-
SVGTag::SVG => "svg",
62+
SVGTag::Svg => "svg",
6363
SVGTag::Circle => "circle",
6464
SVGTag::Line => "line",
6565
SVGTag::Polyline => "polyline",
@@ -92,14 +92,14 @@ impl<'a> SVGBackend<'a> {
9292
}
9393
fn open_tag(&mut self, tag: SVGTag, attr: &[(&str, &str)], close: bool) {
9494
let buf = self.target.get_mut();
95-
buf.push_str("<");
95+
buf.push('<');
9696
buf.push_str(tag.to_tag_name());
9797
for (key, value) in attr {
98-
buf.push_str(" ");
98+
buf.push(' ');
9999
buf.push_str(key);
100100
buf.push_str("=\"");
101101
Self::escape_and_push(buf, value);
102-
buf.push_str("\"");
102+
buf.push('\"');
103103
}
104104
if close {
105105
buf.push_str("/>\n");
@@ -122,7 +122,7 @@ impl<'a> SVGBackend<'a> {
122122

123123
fn init_svg_file(&mut self, size: (u32, u32)) {
124124
self.open_tag(
125-
SVGTag::SVG,
125+
SVGTag::Svg,
126126
&[
127127
("width", &format!("{}", size.0)),
128128
("height", &format!("{}", size.1)),
@@ -472,7 +472,7 @@ impl<'a> DrawingBackend for SVGBackend<'a> {
472472
);
473473

474474
Self::escape_and_push(self.target.get_mut(), text);
475-
self.target.get_mut().push_str("\n");
475+
self.target.get_mut().push('\n');
476476

477477
self.close_tag();
478478

plotters/clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
msrv = "1.39"
1+
msrv = "1.56"

0 commit comments

Comments
 (0)