From ae7422741481abe587e63bc312e001bb03264b98 Mon Sep 17 00:00:00 2001 From: John Nunley Date: Sun, 30 Jul 2023 10:42:30 -0700 Subject: [PATCH] Fix failing doctest --- README.md | 2 +- src/lib.rs | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 0e423bf..11c8ba7 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ surface.on_draw(move || async move { // If you don't have any other windows to draw, make sure the windows are // presented. - display.present().await.expect("failed to present"); + display.present().await; }); ``` diff --git a/src/lib.rs b/src/lib.rs index 51f942c..9bc63b7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -51,6 +51,7 @@ //! # unimplemented!() //! # } //! # } +//! # #[derive(Copy, Clone)] //! # struct Window; //! # unsafe impl raw_window_handle::HasRawWindowHandle for Window { //! # fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle { @@ -60,7 +61,7 @@ //! # impl Window { //! # fn width(&self) -> u32 { 0 } //! # fn height(&self) -> u32 { 0 } -//! # fn on_draw(&self, f: impl FnOnce()) { f() } +//! # fn on_draw(&self, f: impl FnOnce() -> R) { f(); } //! # } //! # let my_display = MyDisplay; //! # let window = Window; @@ -108,7 +109,8 @@ //! ctx.finish().expect("failed to finish drawing"); //! //! // Present the display. -//! display.present().await.expect("failed to present display"); +//! drop(ctx); +//! display.present().await; //! }); //! # }); //! ```