include README.md in doctest, fix example

This commit is contained in:
Vinzenz Schroeter 2024-05-26 16:17:11 +02:00
parent 333cf954f8
commit 1a69cb0932
2 changed files with 6 additions and 1 deletions

View file

@ -18,7 +18,7 @@ fn main() {
.expect("connection failed");
// clear screen content
connection.send(servicepoint::Command::Clear.into())
connection.send(servicepoint::Command::Clear)
.expect("send failed");
}
```

View file

@ -42,3 +42,8 @@ pub const PIXEL_COUNT: usize = PIXEL_WIDTH * PIXEL_HEIGHT;
/// Actual hardware limit is around 28-29ms/frame. Rounded up for less dropped packets.
pub const FRAME_PACING: Duration = Duration::from_millis(30);
// include README.md in doctest
#[doc = include_str!("../README.md")]
#[cfg(doctest)]
pub struct ReadmeDocTests;