From 1a69cb0932d87beb3b5592f00945c66e761940b9 Mon Sep 17 00:00:00 2001 From: Vinzenz Schroeter Date: Sun, 26 May 2024 16:17:11 +0200 Subject: [PATCH] include README.md in doctest, fix example --- crates/servicepoint/README.md | 2 +- crates/servicepoint/src/lib.rs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/servicepoint/README.md b/crates/servicepoint/README.md index 9d7064b..dec2997 100644 --- a/crates/servicepoint/README.md +++ b/crates/servicepoint/README.md @@ -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"); } ``` diff --git a/crates/servicepoint/src/lib.rs b/crates/servicepoint/src/lib.rs index 5b3bcea..7263a6c 100644 --- a/crates/servicepoint/src/lib.rs +++ b/crates/servicepoint/src/lib.rs @@ -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;