Skip to content

Commit ae74227

Browse files
committed
Fix failing doctest
1 parent 592c1c7 commit ae74227

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ surface.on_draw(move || async move {
6363

6464
// If you don't have any other windows to draw, make sure the windows are
6565
// presented.
66-
display.present().await.expect("failed to present");
66+
display.present().await;
6767
});
6868
```
6969

src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
//! # unimplemented!()
5252
//! # }
5353
//! # }
54+
//! # #[derive(Copy, Clone)]
5455
//! # struct Window;
5556
//! # unsafe impl raw_window_handle::HasRawWindowHandle for Window {
5657
//! # fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
@@ -60,7 +61,7 @@
6061
//! # impl Window {
6162
//! # fn width(&self) -> u32 { 0 }
6263
//! # fn height(&self) -> u32 { 0 }
63-
//! # fn on_draw(&self, f: impl FnOnce()) { f() }
64+
//! # fn on_draw<R>(&self, f: impl FnOnce() -> R) { f(); }
6465
//! # }
6566
//! # let my_display = MyDisplay;
6667
//! # let window = Window;
@@ -108,7 +109,8 @@
108109
//! ctx.finish().expect("failed to finish drawing");
109110
//!
110111
//! // Present the display.
111-
//! display.present().await.expect("failed to present display");
112+
//! drop(ctx);
113+
//! display.present().await;
112114
//! });
113115
//! # });
114116
//! ```

0 commit comments

Comments
 (0)