Fix unused field warning
This commit is contained in:
parent
fbfe108317
commit
fdcb413e33
3 changed files with 3 additions and 7 deletions
|
@ -614,7 +614,7 @@ impl AppContext {
|
||||||
})
|
})
|
||||||
.collect::<Vec<_>>()
|
.collect::<Vec<_>>()
|
||||||
{
|
{
|
||||||
self.update_window(window, |_, cx| cx.draw()).ok();
|
self.update_window(window, |_, cx| cx.draw()).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -136,12 +136,11 @@ impl Platform for TestPlatform {
|
||||||
&self,
|
&self,
|
||||||
handle: AnyWindowHandle,
|
handle: AnyWindowHandle,
|
||||||
options: WindowOptions,
|
options: WindowOptions,
|
||||||
draw: Box<dyn FnMut() -> Result<Scene>>,
|
_draw: Box<dyn FnMut() -> Result<Scene>>,
|
||||||
) -> Box<dyn crate::PlatformWindow> {
|
) -> Box<dyn crate::PlatformWindow> {
|
||||||
*self.active_window.lock() = Some(handle);
|
*self.active_window.lock() = Some(handle);
|
||||||
Box::new(TestWindow::new(
|
Box::new(TestWindow::new(
|
||||||
options,
|
options,
|
||||||
draw,
|
|
||||||
self.weak.clone(),
|
self.weak.clone(),
|
||||||
self.active_display.clone(),
|
self.active_display.clone(),
|
||||||
))
|
))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
use crate::{
|
use crate::{
|
||||||
px, AtlasKey, AtlasTextureId, AtlasTile, DrawWindow, Pixels, PlatformAtlas, PlatformDisplay,
|
px, AtlasKey, AtlasTextureId, AtlasTile, Pixels, PlatformAtlas, PlatformDisplay,
|
||||||
PlatformInputHandler, PlatformWindow, Point, Size, TestPlatform, TileId, WindowAppearance,
|
PlatformInputHandler, PlatformWindow, Point, Size, TestPlatform, TileId, WindowAppearance,
|
||||||
WindowBounds, WindowOptions,
|
WindowBounds, WindowOptions,
|
||||||
};
|
};
|
||||||
|
@ -20,7 +20,6 @@ pub(crate) struct TestWindowHandlers {
|
||||||
|
|
||||||
pub struct TestWindow {
|
pub struct TestWindow {
|
||||||
pub(crate) bounds: WindowBounds,
|
pub(crate) bounds: WindowBounds,
|
||||||
draw: Mutex<DrawWindow>,
|
|
||||||
display: Rc<dyn PlatformDisplay>,
|
display: Rc<dyn PlatformDisplay>,
|
||||||
pub(crate) window_title: Option<String>,
|
pub(crate) window_title: Option<String>,
|
||||||
pub(crate) input_handler: Option<Arc<Mutex<Box<dyn PlatformInputHandler>>>>,
|
pub(crate) input_handler: Option<Arc<Mutex<Box<dyn PlatformInputHandler>>>>,
|
||||||
|
@ -32,13 +31,11 @@ pub struct TestWindow {
|
||||||
impl TestWindow {
|
impl TestWindow {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
options: WindowOptions,
|
options: WindowOptions,
|
||||||
draw: DrawWindow,
|
|
||||||
platform: Weak<TestPlatform>,
|
platform: Weak<TestPlatform>,
|
||||||
display: Rc<dyn PlatformDisplay>,
|
display: Rc<dyn PlatformDisplay>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
bounds: options.bounds,
|
bounds: options.bounds,
|
||||||
draw: Mutex::new(draw),
|
|
||||||
display,
|
display,
|
||||||
platform,
|
platform,
|
||||||
input_handler: None,
|
input_handler: None,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue