Skip to content

Commit bb61529

Browse files
authored
Merge pull request #174 from embedded-graphics/ci
Tweak CI
2 parents 9990266 + d68bb86 commit bb61529

File tree

4 files changed

+37
-13
lines changed

4 files changed

+37
-13
lines changed

.github/workflows/rust.yml

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ env:
1111

1212
jobs:
1313

14-
formatting:
14+
linting:
1515
runs-on: ubuntu-latest
1616

1717
steps:
@@ -23,17 +23,17 @@ jobs:
2323
toolchain: stable
2424
target: thumbv7em-none-eabihf
2525
override: true
26-
components: rustfmt
26+
components: rustfmt, clippy
2727

2828
- name: Check formatting
2929
run: cargo fmt --all -- --check
3030

31+
- name: Run clippy
32+
run: cargo clippy -- -D warnings
33+
3134
build-nostd:
3235
runs-on: ubuntu-latest
3336

34-
needs:
35-
- formatting
36-
3737
steps:
3838
- uses: actions/checkout@v2
3939

@@ -47,11 +47,24 @@ jobs:
4747
- name: Build no_std
4848
run: cargo build --verbose --target thumbv7em-none-eabihf -Z avoid-dev-deps
4949

50-
build:
50+
build-msrv:
5151
runs-on: ubuntu-latest
5252

53-
needs:
54-
- formatting
53+
steps:
54+
- uses: actions/checkout@v2
55+
56+
- uses: actions-rs/toolchain@v1
57+
with:
58+
profile: minimal
59+
toolchain: 1.61
60+
target: thumbv7em-none-eabihf
61+
override: true
62+
63+
- name: Build with MSRV
64+
run: cargo build
65+
66+
build:
67+
runs-on: ubuntu-latest
5568

5669
strategy:
5770
matrix:
@@ -65,9 +78,6 @@ jobs:
6578
- name: nightly
6679
rust: nightly
6780

68-
- name: msrv
69-
rust: 1.61.0
70-
7181
steps:
7282
- uses: actions/checkout@v2
7383

@@ -132,7 +142,7 @@ jobs:
132142
toolchain: stable
133143
target: thumbv7em-none-eabihf
134144
override: true
135-
145+
136146
- name: Check doc links
137147
run: |
138148
cargo doc --color=never &> ./out

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
Unreleased
2+
==========
3+
4+
- [#174] Implement `Default` for `TextBoxStyleBuilder`
5+
6+
[#174]: https://github.com/embedded-graphics/embedded-text/pull/174
7+
18
0.7.3 (2025-10-10)
29
==================
310

src/style/builder.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,13 @@ pub struct TextBoxStyleBuilder {
1515
trailing_spaces: Option<bool>,
1616
}
1717

18+
impl Default for TextBoxStyleBuilder {
19+
#[inline]
20+
fn default() -> Self {
21+
Self::new()
22+
}
23+
}
24+
1825
impl TextBoxStyleBuilder {
1926
/// Create a new builder object.
2027
#[inline]

src/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ pub fn str_width_and_left_offset(renderer: &impl TextRenderer, s: &str) -> (u32,
2222
let tm = renderer.measure_string(s, Point::zero(), Baseline::Top);
2323
(
2424
tm.next_position.x as u32,
25-
tm.bounding_box.top_left.x.min(0).abs() as u32,
25+
tm.bounding_box.top_left.x.min(0).unsigned_abs(),
2626
)
2727
}
2828

0 commit comments

Comments
 (0)