Skip to content

Commit 0ca2d78

Browse files
committed
Fix the MSRV issue on v0.2.13
1 parent 2d95e90 commit 0ca2d78

File tree

6 files changed

+34
-1
lines changed

6 files changed

+34
-1
lines changed

.github/workflows/push-check.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,20 @@ name: Push Check
33
on: [push]
44

55
jobs:
6+
msrv:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v1
10+
with:
11+
submodules: recursive
12+
- uses: actions-rs/toolchain@v1
13+
with:
14+
toolchain: 1.36.0
15+
override: true
16+
- uses: actions-rs/cargo@v1
17+
with:
18+
command: test
19+
args: --verbose --all-features
620
build_and_test:
721
runs-on: ${{ matrix.os }}
822
strategy:

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## Plotters latest (?)
4+
### Fixed
5+
6+
- Compile error with older rustc which causing breaks
7+
38
## Plotters 0.2.13 (2020-05-04)
49
### Added
510

CONTRIBUTING.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ cargo test --lib --target wasm32-unknown-unknown
105105

106106
For the debugging you could set the `NO_HEADLESS=1` environment variable to run the tests using the local server instead of the headless browser.
107107

108+
### Minimal Supported Compiler Version
109+
110+
Currently we should make sure Plotters is compatible with rustc 1.36.0.
111+
Before making a PR, please check if the code compile with 1.36.0
112+
108113
### Code Coverage
109114

110115
For for the code coverage information you may want to use [cargo-tarpaulin](https://crates.io/crates/cargo-tarpaulin). Please note that it works with x86_64 GNU/Linux only, and the doc tests coverage require nightly Rust.
@@ -122,3 +127,5 @@ Usage:
122127
cargo tarpaulin --all-features --run-types Tests Doctests -o Xml --output-dir target/test
123128
pycobertura show target/test/cobertura.xml
124129
```
130+
131+

doc-template/msrv.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.36.0

publish.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ git add -u .
3434
git commit -m "Bump version number from ${OLD_VERSION} to ${NEW_VERSION}"
3535
git tag -a "v${NEW_VERSION}" -m "Plotters ${NEW_VERSION} release"
3636

37+
# Verify MSRV
38+
rustup install $(cat ${ROOT}/doc-template/msrv.txt)
39+
rustup default $(cat ${ROOT}/doc-template/msrv.txt)
40+
cargo build
41+
rustup default stable
42+
3743
cargo publish
3844
git push origin
3945
git push origin "v${NEW_VERSION}"

src/chart/context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ pub struct SeriesAnno<'a, DB: DrawingBackend> {
2929

3030
impl<'a, DB: DrawingBackend> SeriesAnno<'a, DB> {
3131
pub(crate) fn get_label(&self) -> &str {
32-
self.label.as_deref().map(|x| x).unwrap_or("")
32+
self.label.as_ref().map(|x| x.as_str()).unwrap_or("")
3333
}
3434

3535
pub(crate) fn get_draw_func(

0 commit comments

Comments
 (0)