File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ surface.on_draw(move || async move {
63
63
64
64
// If you don't have any other windows to draw, make sure the windows are
65
65
// presented.
66
- display . present (). await . expect ( " failed to present " ) ;
66
+ display . present (). await ;
67
67
});
68
68
```
69
69
Original file line number Diff line number Diff line change 51
51
//! # unimplemented!()
52
52
//! # }
53
53
//! # }
54
+ //! # #[derive(Copy, Clone)]
54
55
//! # struct Window;
55
56
//! # unsafe impl raw_window_handle::HasRawWindowHandle for Window {
56
57
//! # fn raw_window_handle(&self) -> raw_window_handle::RawWindowHandle {
60
61
//! # impl Window {
61
62
//! # fn width(&self) -> u32 { 0 }
62
63
//! # 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(); }
64
65
//! # }
65
66
//! # let my_display = MyDisplay;
66
67
//! # let window = Window;
108
109
//! ctx.finish().expect("failed to finish drawing");
109
110
//!
110
111
//! // Present the display.
111
- //! display.present().await.expect("failed to present display");
112
+ //! drop(ctx);
113
+ //! display.present().await;
112
114
//! });
113
115
//! # });
114
116
//! ```
You can’t perform that action at this time.
0 commit comments