Fix unused field warning

This commit is contained in:
Max Brunsfeld 2023-12-11 12:56:18 -08:00
parent fbfe108317
commit fdcb413e33
3 changed files with 3 additions and 7 deletions

View file

@ -614,7 +614,7 @@ impl AppContext {
})
.collect::<Vec<_>>()
{
self.update_window(window, |_, cx| cx.draw()).ok();
self.update_window(window, |_, cx| cx.draw()).unwrap();
}
}

View file

@ -136,12 +136,11 @@ impl Platform for TestPlatform {
&self,
handle: AnyWindowHandle,
options: WindowOptions,
draw: Box<dyn FnMut() -> Result<Scene>>,
_draw: Box<dyn FnMut() -> Result<Scene>>,
) -> Box<dyn crate::PlatformWindow> {
*self.active_window.lock() = Some(handle);
Box::new(TestWindow::new(
options,
draw,
self.weak.clone(),
self.active_display.clone(),
))

View file

@ -1,5 +1,5 @@
use crate::{
px, AtlasKey, AtlasTextureId, AtlasTile, DrawWindow, Pixels, PlatformAtlas, PlatformDisplay,
px, AtlasKey, AtlasTextureId, AtlasTile, Pixels, PlatformAtlas, PlatformDisplay,
PlatformInputHandler, PlatformWindow, Point, Size, TestPlatform, TileId, WindowAppearance,
WindowBounds, WindowOptions,
};
@ -20,7 +20,6 @@ pub(crate) struct TestWindowHandlers {
pub struct TestWindow {
pub(crate) bounds: WindowBounds,
draw: Mutex<DrawWindow>,
display: Rc<dyn PlatformDisplay>,
pub(crate) window_title: Option<String>,
pub(crate) input_handler: Option<Arc<Mutex<Box<dyn PlatformInputHandler>>>>,
@ -32,13 +31,11 @@ pub struct TestWindow {
impl TestWindow {
pub fn new(
options: WindowOptions,
draw: DrawWindow,
platform: Weak<TestPlatform>,
display: Rc<dyn PlatformDisplay>,
) -> Self {
Self {
bounds: options.bounds,
draw: Mutex::new(draw),
display,
platform,
input_handler: None,