Add EventLoop::builder, which replaces EventLoopBuilder::new

Similarly for EventLoop::with_user_event and EventLoopBuilder::with_user_event
This commit is contained in:
Mads Marquart 2023-08-30 10:54:46 +02:00 committed by John Nunley
parent 569c44a632
commit 8862ce0163
3 changed files with 31 additions and 23 deletions

View file

@ -5,7 +5,7 @@ fn main() -> Result<(), impl std::error::Error> {
use simple_logger::SimpleLogger;
use winit::{
event::{Event, WindowEvent},
event_loop::EventLoopBuilder,
event_loop::EventLoop,
window::Window,
};
@ -18,9 +18,7 @@ fn main() -> Result<(), impl std::error::Error> {
}
SimpleLogger::new().init().unwrap();
let event_loop = EventLoopBuilder::<CustomEvent>::with_user_event()
.build()
.unwrap();
let event_loop = EventLoop::<CustomEvent>::with_user_event().build().unwrap();
let window = Window::builder()
.with_title("A fantastic window!")