Skip to content

Commit 9be2df3

Browse files
committed
chore: fix clippy warnings; update readme
1 parent aafcd48 commit 9be2df3

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The `litehtml` crate has these feature flags:
2525
## Usage
2626

2727
```rust
28+
use litehtml::{Document, DrawContext};
2829
use litehtml::pixbuf::{PixbufContainer, render_to_rgba};
2930

3031
// Quick render to RGBA pixel buffer
@@ -36,15 +37,15 @@ let master_css = litehtml::email::EMAIL_MASTER_CSS;
3637

3738
if let Ok(mut doc) = Document::from_html(html, &mut container, Some(master_css), None) {
3839
doc.render(600.0);
39-
doc.draw(0, 0.0, 0.0, None);
40+
doc.draw(DrawContext::default(), 0.0, 0.0, None);
4041
}
4142

4243
let pixels = container.pixels(); // premultiplied RGBA
4344
```
4445

4546
## Building
4647

47-
Requires a C++17 compiler and `clang` (for bindgen).
48+
Requires a C++17 compiler. Bindgen output is pre-generated; `clang` is only needed if you enable the `buildtime-bindgen` feature in `litehtml-sys`.
4849

4950
With direnv (GUIX -- see `.envrc`):
5051

litehtml/examples/browse.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ fn main() {
497497
selection_rects.clear();
498498
last_mouse = Some((mx, my));
499499
} else if mouse_down {
500-
let moved = last_mouse.map_or(true, |(lx, ly)| {
500+
let moved = last_mouse.is_none_or(|(lx, ly)| {
501501
(mx - lx).abs() > 0.5 || (my - ly).abs() > 0.5
502502
});
503503

litehtml/examples/render.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fn main() {
160160
selection_rects.clear();
161161
last_mouse = Some((mx, my));
162162
} else if mouse_down {
163-
let moved = last_mouse.map_or(true, |(lx, ly)| {
163+
let moved = last_mouse.is_none_or(|(lx, ly)| {
164164
(mx - lx).abs() > 0.5 || (my - ly).abs() > 0.5
165165
});
166166

0 commit comments

Comments
 (0)