Skip to content

Commit d68bb86

Browse files
committed
Fix clippy lints
1 parent 22ac8a2 commit d68bb86

3 files changed

Lines changed: 15 additions & 1 deletion

File tree

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)