Remove unneeded unsafe. Fix unused result return

This commit is contained in:
Jarrod Doyle 2024-03-22 12:01:12 +00:00
parent 881de4e3b9
commit 12e110744d
Signed by: Jayrude
GPG Key ID: 38B57B16E7C0ADF7
2 changed files with 3 additions and 6 deletions

View File

@ -86,7 +86,7 @@ impl<'window> App<'window> {
let mut cumulative_dt = 0.0; let mut cumulative_dt = 0.0;
let mut frames_accumulated = 0.0; let mut frames_accumulated = 0.0;
let mut last_render_time = Instant::now(); let mut last_render_time = Instant::now();
self.event_loop.run(|event, elwt| { let _ = self.event_loop.run(|event, elwt| {
match event { match event {
Event::WindowEvent { window_id, event } Event::WindowEvent { window_id, event }
if window_id == self.render_ctx.window.id() => if window_id == self.render_ctx.window.id() =>

View File

@ -1,10 +1,7 @@
use std::sync::Arc; use std::sync::Arc;
use winit::{ use winit::{
dpi::PhysicalSize, dpi::PhysicalSize, event::WindowEvent, event_loop::EventLoopWindowTarget, window::Window,
event::{Event, WindowEvent},
event_loop::{ControlFlow, EventLoopWindowTarget},
window::Window,
}; };
pub struct Context<'window> { pub struct Context<'window> {
@ -32,7 +29,7 @@ impl<'window> Context<'window> {
// - A GPU device to draw to the surface // - A GPU device to draw to the surface
// - A draw command queue // - A draw command queue
log::info!("Initialising window surface..."); log::info!("Initialising window surface...");
let surface = unsafe { instance.create_surface(window.clone()) }.unwrap(); let surface = instance.create_surface(window.clone()).unwrap();
log::info!("Requesting GPU adapter..."); log::info!("Requesting GPU adapter...");
let adapter = instance let adapter = instance