diff --git a/examples/child_window.rs b/examples/child_window.rs index 8cb1a883..b1b8f95e 100644 --- a/examples/child_window.rs +++ b/examples/child_window.rs @@ -27,7 +27,7 @@ fn main() { let id = child_window.id(); windows.insert(id, child_window); - println!("child window created with id: {:?}", id); + println!("child window created with id: {id:?}"); } let mut windows = HashMap::new(); @@ -40,7 +40,7 @@ fn main() { .build(&event_loop) .unwrap(); - println!("parent window: {:?})", parent_window); + println!("parent window: {parent_window:?})"); event_loop.run(move |event: Event<'_, ()>, event_loop, control_flow| { *control_flow = ControlFlow::Wait; @@ -56,7 +56,7 @@ fn main() { // by some key inputs. // the child windows are always placed at (0, 0) with size (200, 200) in the parent window, // so we also can see this log when we move the cursor arround (200, 200) in parent window. - println!("cursor entered in the window {:?}", window_id); + println!("cursor entered in the window {window_id:?}"); } WindowEvent::KeyboardInput { input: diff --git a/examples/control_flow.rs b/examples/control_flow.rs index 94926d77..bade79d2 100644 --- a/examples/control_flow.rs +++ b/examples/control_flow.rs @@ -41,7 +41,7 @@ fn main() { event_loop.run(move |event, _, control_flow| { use winit::event::{ElementState, StartCause, VirtualKeyCode}; - println!("{:?}", event); + println!("{event:?}"); match event { Event::NewEvents(start_cause) => { wait_cancelled = match start_cause { @@ -64,19 +64,19 @@ fn main() { } => match virtual_code { VirtualKeyCode::Key1 => { mode = Mode::Wait; - println!("\nmode: {:?}\n", mode); + println!("\nmode: {mode:?}\n"); } VirtualKeyCode::Key2 => { mode = Mode::WaitUntil; - println!("\nmode: {:?}\n", mode); + println!("\nmode: {mode:?}\n"); } VirtualKeyCode::Key3 => { mode = Mode::Poll; - println!("\nmode: {:?}\n", mode); + println!("\nmode: {mode:?}\n"); } VirtualKeyCode::R => { request_redraw = !request_redraw; - println!("\nrequest_redraw: {}\n", request_redraw); + println!("\nrequest_redraw: {request_redraw}\n"); } VirtualKeyCode::Escape => { close_requested = true; diff --git a/examples/cursor_grab.rs b/examples/cursor_grab.rs index cff77885..79253e10 100644 --- a/examples/cursor_grab.rs +++ b/examples/cursor_grab.rs @@ -50,17 +50,17 @@ fn main() { }; if let Err(err) = result { - println!("error: {}", err); + println!("error: {err}"); } } WindowEvent::ModifiersChanged(m) => modifiers = m, _ => (), }, Event::DeviceEvent { event, .. } => match event { - DeviceEvent::MouseMotion { delta } => println!("mouse moved: {:?}", delta), + DeviceEvent::MouseMotion { delta } => println!("mouse moved: {delta:?}"), DeviceEvent::Button { button, state } => match state { - ElementState::Pressed => println!("mouse button {} pressed", button), - ElementState::Released => println!("mouse button {} released", button), + ElementState::Pressed => println!("mouse button {button} pressed"), + ElementState::Released => println!("mouse button {button} released"), }, _ => (), }, diff --git a/examples/custom_events.rs b/examples/custom_events.rs index 61077c8b..b3935315 100644 --- a/examples/custom_events.rs +++ b/examples/custom_events.rs @@ -39,7 +39,7 @@ fn main() { control_flow.set_wait(); match event { - Event::UserEvent(event) => println!("user event: {:?}", event), + Event::UserEvent(event) => println!("user event: {event:?}"), Event::WindowEvent { event: WindowEvent::CloseRequested, .. diff --git a/examples/fullscreen.rs b/examples/fullscreen.rs index 6bfda4c2..6f4d98e2 100644 --- a/examples/fullscreen.rs +++ b/examples/fullscreen.rs @@ -26,7 +26,7 @@ fn main() { let mut mode_index = 0; let mut mode = monitor.video_modes().next().expect("no mode found"); - println!("Mode: {}", mode); + println!("Mode: {mode}"); println!("Keys:"); println!("- Esc\tExit"); @@ -59,12 +59,12 @@ fn main() { } VirtualKeyCode::F => { let fullscreen = Some(Fullscreen::Exclusive(mode.clone())); - println!("Setting mode: {:?}", fullscreen); + println!("Setting mode: {fullscreen:?}"); window.set_fullscreen(fullscreen); } VirtualKeyCode::B => { let fullscreen = Some(Fullscreen::Borderless(Some(monitor.clone()))); - println!("Setting mode: {:?}", fullscreen); + println!("Setting mode: {fullscreen:?}"); window.set_fullscreen(fullscreen); } VirtualKeyCode::S => { @@ -79,7 +79,7 @@ fn main() { mode_index = 0; mode = monitor.video_modes().next().expect("no mode found"); - println!("Mode: {}", mode); + println!("Mode: {mode}"); } VirtualKeyCode::M => { mode_index += 1; @@ -89,7 +89,7 @@ fn main() { mode_index = 0; mode = monitor.video_modes().next().expect("no mode found"); } - println!("Mode: {}", mode); + println!("Mode: {mode}"); } VirtualKeyCode::D => { decorations = !decorations; diff --git a/examples/ime.rs b/examples/ime.rs index bdf67a86..2df78045 100644 --- a/examples/ime.rs +++ b/examples/ime.rs @@ -67,7 +67,7 @@ fn main() { event: WindowEvent::Ime(event), .. } => { - println!("{:?}", event); + println!("{event:?}"); may_show_ime = event != Ime::Disabled; if may_show_ime { window.set_ime_position(ime_pos); @@ -77,20 +77,20 @@ fn main() { event: WindowEvent::ReceivedCharacter(ch), .. } => { - println!("ch: {:?}", ch); + println!("ch: {ch:?}"); } Event::WindowEvent { event: WindowEvent::KeyboardInput { input, .. }, .. } => { - println!("key: {:?}", input); + println!("key: {input:?}"); if input.state == ElementState::Pressed && input.virtual_keycode == Some(VirtualKeyCode::F2) { ime_allowed = !ime_allowed; window.set_ime_allowed(ime_allowed); - println!("\nIME: {}\n", ime_allowed); + println!("\nIME: {ime_allowed}\n"); } } _ => (), diff --git a/examples/mouse_wheel.rs b/examples/mouse_wheel.rs index c1d8f0cb..239f5a4e 100644 --- a/examples/mouse_wheel.rs +++ b/examples/mouse_wheel.rs @@ -39,7 +39,7 @@ In other words, the deltas indicate the direction in which to move the content ( WindowEvent::CloseRequested => control_flow.set_exit(), WindowEvent::MouseWheel { delta, .. } => match delta { winit::event::MouseScrollDelta::LineDelta(x, y) => { - println!("mouse wheel Line Delta: ({},{})", x, y); + println!("mouse wheel Line Delta: ({x},{y})"); let pixels_per_line = 120.0; let mut pos = window.outer_position().unwrap(); pos.x += (x * pixels_per_line) as i32; diff --git a/examples/multithreaded.rs b/examples/multithreaded.rs index a5bdcd3d..7e03329d 100644 --- a/examples/multithreaded.rs +++ b/examples/multithreaded.rs @@ -62,7 +62,7 @@ fn main() { }, .. } => { - window.set_title(&format!("{:?}", key)); + window.set_title(&format!("{key:?}")); let state = !modifiers.shift(); use VirtualKeyCode::*; match key { @@ -92,17 +92,17 @@ fn main() { }), L if state => { if let Err(err) = window.set_cursor_grab(CursorGrabMode::Locked) { - println!("error: {}", err); + println!("error: {err}"); } } G if state => { if let Err(err) = window.set_cursor_grab(CursorGrabMode::Confined) { - println!("error: {}", err); + println!("error: {err}"); } } G | L if !state => { if let Err(err) = window.set_cursor_grab(CursorGrabMode::None) { - println!("error: {}", err); + println!("error: {err}"); } } H => window.set_cursor_visible(!state), diff --git a/examples/multiwindow.rs b/examples/multiwindow.rs index de87962d..3409af5a 100644 --- a/examples/multiwindow.rs +++ b/examples/multiwindow.rs @@ -29,7 +29,7 @@ fn main() { Event::WindowEvent { event, window_id } => { match event { WindowEvent::CloseRequested => { - println!("Window {:?} has received the signal to close", window_id); + println!("Window {window_id:?} has received the signal to close"); // This drops the window, causing it to close. windows.remove(&window_id); diff --git a/examples/request_redraw.rs b/examples/request_redraw.rs index 93bb4398..aa53050d 100644 --- a/examples/request_redraw.rs +++ b/examples/request_redraw.rs @@ -17,7 +17,7 @@ fn main() { .unwrap(); event_loop.run(move |event, _, control_flow| { - println!("{:?}", event); + println!("{event:?}"); control_flow.set_wait(); diff --git a/examples/request_redraw_threaded.rs b/examples/request_redraw_threaded.rs index 759de6f6..d92389c5 100644 --- a/examples/request_redraw_threaded.rs +++ b/examples/request_redraw_threaded.rs @@ -25,7 +25,7 @@ fn main() { }); event_loop.run(move |event, _, control_flow| { - println!("{:?}", event); + println!("{event:?}"); control_flow.set_wait(); diff --git a/examples/resizable.rs b/examples/resizable.rs index 9e438a51..8f16172f 100644 --- a/examples/resizable.rs +++ b/examples/resizable.rs @@ -39,7 +39,7 @@ fn main() { .. } => { resizable = !resizable; - println!("Resizable: {}", resizable); + println!("Resizable: {resizable}"); window.set_resizable(resizable); } _ => (), diff --git a/examples/theme.rs b/examples/theme.rs index 6cbbd8b9..ac8854e2 100644 --- a/examples/theme.rs +++ b/examples/theme.rs @@ -36,7 +36,7 @@ fn main() { window_id, .. } if window_id == window.id() => { - println!("Theme is changed: {:?}", theme) + println!("Theme is changed: {theme:?}") } Event::WindowEvent { event: diff --git a/examples/timer.rs b/examples/timer.rs index c312460b..4d609bef 100644 --- a/examples/timer.rs +++ b/examples/timer.rs @@ -22,7 +22,7 @@ fn main() { let timer_length = Duration::new(1, 0); event_loop.run(move |event, _, control_flow| { - println!("{:?}", event); + println!("{event:?}"); match event { Event::NewEvents(StartCause::Init) => { diff --git a/examples/touchpad_gestures.rs b/examples/touchpad_gestures.rs index 54c37715..1a749a19 100644 --- a/examples/touchpad_gestures.rs +++ b/examples/touchpad_gestures.rs @@ -24,9 +24,9 @@ fn main() { WindowEvent::CloseRequested => *control_flow = ControlFlow::Exit, WindowEvent::TouchpadMagnify { delta, .. } => { if delta > 0.0 { - println!("Zoomed in {}", delta); + println!("Zoomed in {delta}"); } else { - println!("Zoomed out {}", delta); + println!("Zoomed out {delta}"); } } WindowEvent::SmartMagnify { .. } => { @@ -34,9 +34,9 @@ fn main() { } WindowEvent::TouchpadRotate { delta, .. } => { if delta > 0.0 { - println!("Rotated counterclockwise {}", delta); + println!("Rotated counterclockwise {delta}"); } else { - println!("Rotated clockwise {}", delta); + println!("Rotated clockwise {delta}"); } } _ => (), diff --git a/examples/transparent.rs b/examples/transparent.rs index 9080cbef..88c69d1b 100644 --- a/examples/transparent.rs +++ b/examples/transparent.rs @@ -21,7 +21,7 @@ fn main() { event_loop.run(move |event, _, control_flow| { control_flow.set_wait(); - println!("{:?}", event); + println!("{event:?}"); match event { Event::WindowEvent { diff --git a/examples/video_modes.rs b/examples/video_modes.rs index afc4ad6b..3b262c7b 100644 --- a/examples/video_modes.rs +++ b/examples/video_modes.rs @@ -17,6 +17,6 @@ fn main() { println!("Listing available video modes:"); for mode in monitor.video_modes() { - println!("{}", mode); + println!("{mode}"); } } diff --git a/examples/web.rs b/examples/web.rs index fe758064..5be8af29 100644 --- a/examples/web.rs +++ b/examples/web.rs @@ -81,7 +81,7 @@ mod wasm { let window = web_sys::window().unwrap(); let document = window.document().unwrap(); let log = document.create_element("li").unwrap(); - log.set_text_content(Some(&format!("{:?}", event))); + log.set_text_content(Some(&format!("{event:?}"))); log_list .insert_before(&log, log_list.first_child().as_ref()) .unwrap(); diff --git a/examples/window.rs b/examples/window.rs index 23a633d2..e54a2f66 100644 --- a/examples/window.rs +++ b/examples/window.rs @@ -19,7 +19,7 @@ fn main() { event_loop.run(move |event, _, control_flow| { control_flow.set_wait(); - println!("{:?}", event); + println!("{event:?}"); match event { Event::WindowEvent { diff --git a/examples/window_run_return.rs b/examples/window_run_return.rs index 395076b5..f088a514 100644 --- a/examples/window_run_return.rs +++ b/examples/window_run_return.rs @@ -35,7 +35,7 @@ fn main() { if let Event::WindowEvent { event, .. } = &event { // Print only Window events to reduce noise - println!("{:?}", event); + println!("{event:?}"); } match event { diff --git a/src/icon.rs b/src/icon.rs index 982e5f5d..29276659 100644 --- a/src/icon.rs +++ b/src/icon.rs @@ -34,8 +34,7 @@ impl fmt::Display for BadIcon { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { BadIcon::ByteCountNotDivisibleBy4 { byte_count } => write!(f, - "The length of the `rgba` argument ({:?}) isn't divisible by 4, making it impossible to interpret as 32bpp RGBA pixels.", - byte_count, + "The length of the `rgba` argument ({byte_count:?}) isn't divisible by 4, making it impossible to interpret as 32bpp RGBA pixels.", ), BadIcon::DimensionsVsPixelCount { width, @@ -43,10 +42,9 @@ impl fmt::Display for BadIcon { width_x_height, pixel_count, } => write!(f, - "The specified dimensions ({:?}x{:?}) don't match the number of pixels supplied by the `rgba` argument ({:?}). For those dimensions, the expected pixel count is {:?}.", - width, height, pixel_count, width_x_height, + "The specified dimensions ({width:?}x{height:?}) don't match the number of pixels supplied by the `rgba` argument ({pixel_count:?}). For those dimensions, the expected pixel count is {width_x_height:?}.", ), - BadIcon::OsError(e) => write!(f, "OS error when instantiating the icon: {:?}", e), + BadIcon::OsError(e) => write!(f, "OS error when instantiating the icon: {e:?}"), } } } diff --git a/src/platform_impl/android/mod.rs b/src/platform_impl/android/mod.rs index d71e9521..f18eb58d 100644 --- a/src/platform_impl/android/mod.rs +++ b/src/platform_impl/android/mod.rs @@ -349,10 +349,10 @@ impl EventLoop { } } - fn single_iteration<'a, F>( + fn single_iteration( &mut self, control_flow: &mut ControlFlow, - main_event: Option>, + main_event: Option>, pending_redraw: &mut bool, cause: &mut StartCause, callback: &mut F, diff --git a/src/platform_impl/linux/mod.rs b/src/platform_impl/linux/mod.rs index efefeea6..ed0cc421 100644 --- a/src/platform_impl/linux/mod.rs +++ b/src/platform_impl/linux/mod.rs @@ -727,8 +727,7 @@ impl EventLoop { panic!("wayland feature is not enabled"); } _ => panic!( - "Unknown environment variable value for {}, try one of `x11`,`wayland`", - BACKEND_PREFERENCE_ENV_VAR, + "Unknown environment variable value for {BACKEND_PREFERENCE_ENV_VAR}, try one of `x11`,`wayland`", ), } } @@ -751,8 +750,7 @@ impl EventLoop { let x11_err = "backend disabled"; panic!( - "Failed to initialize any backend! Wayland status: {:?} X11 status: {:?}", - wayland_err, x11_err, + "Failed to initialize any backend! Wayland status: {wayland_err:?} X11 status: {x11_err:?}", ); } diff --git a/src/platform_impl/linux/x11/ime/callbacks.rs b/src/platform_impl/linux/x11/ime/callbacks.rs index 71283760..fd96afbe 100644 --- a/src/platform_impl/linux/x11/ime/callbacks.rs +++ b/src/platform_impl/linux/x11/ime/callbacks.rs @@ -168,7 +168,7 @@ pub unsafe extern "C" fn xim_instantiate_callback( Err(err) => { if (*inner).is_destroyed { // We have no usable input methods! - panic!("Failed to reopen input method: {:?}", err); + panic!("Failed to reopen input method: {err:?}"); } } } @@ -195,7 +195,7 @@ pub unsafe extern "C" fn xim_destroy_callback( Ok(()) => (*inner).is_fallback = true, Err(err) => { // We have no usable input methods! - panic!("Failed to open fallback input method: {:?}", err); + panic!("Failed to open fallback input method: {err:?}"); } } } diff --git a/src/platform_impl/linux/x11/ime/mod.rs b/src/platform_impl/linux/x11/ime/mod.rs index 4c45cdf5..e0979681 100644 --- a/src/platform_impl/linux/x11/ime/mod.rs +++ b/src/platform_impl/linux/x11/ime/mod.rs @@ -171,7 +171,7 @@ impl Ime { if self.is_destroyed() { return None; } - if let Some(&Some(ref context)) = self.inner.contexts.get(&window) { + if let Some(Some(context)) = self.inner.contexts.get(&window) { Some(context.ic) } else { None diff --git a/src/platform_impl/linux/x11/mod.rs b/src/platform_impl/linux/x11/mod.rs index 8f96c2dc..0ef073d9 100644 --- a/src/platform_impl/linux/x11/mod.rs +++ b/src/platform_impl/linux/x11/mod.rs @@ -175,7 +175,7 @@ impl EventLoop { let ime = RefCell::new({ let result = Ime::new(Arc::clone(&xconn), ime_event_sender); if let Err(ImeCreationError::OpenFailure(ref state)) = result { - panic!("Failed to open input method: {:#?}", state); + panic!("Failed to open input method: {state:#?}"); } result.expect("Failed to set input method destruction callback") }); @@ -212,8 +212,7 @@ impl EventLoop { ) != ffi::Success as libc::c_int { panic!( - "X server has XInput extension {}.{} but does not support XInput2", - xinput_major_ver, xinput_minor_ver, + "X server has XInput extension {xinput_major_ver}.{xinput_minor_ver} but does not support XInput2", ); } } @@ -454,7 +453,7 @@ impl EventLoop { // Wait until if let Err(e) = self.poll.poll(&mut events, iter_result.timeout) { if e.raw_os_error() != Some(libc::EINTR) { - panic!("epoll returned an error: {:?}", e); + panic!("epoll returned an error: {e:?}"); } } events.clear(); diff --git a/src/platform_impl/linux/x11/util/randr.rs b/src/platform_impl/linux/x11/util/randr.rs index 24f9f631..a076157b 100644 --- a/src/platform_impl/linux/x11/util/randr.rs +++ b/src/platform_impl/linux/x11/util/randr.rs @@ -117,8 +117,7 @@ impl XConnection { EnvVarDPI::NotSet } else { panic!( - "`WINIT_X11_SCALE_FACTOR` invalid; DPI factors must be either normal floats greater than 0, or `randr`. Got `{}`", - var + "`WINIT_X11_SCALE_FACTOR` invalid; DPI factors must be either normal floats greater than 0, or `randr`. Got `{var}`" ); } }, @@ -132,8 +131,7 @@ impl XConnection { EnvVarDPI::Scale(dpi_override) => { if !validate_scale_factor(dpi_override) { panic!( - "`WINIT_X11_SCALE_FACTOR` invalid; DPI factors must be either normal floats greater than 0, or `randr`. Got `{}`", - dpi_override, + "`WINIT_X11_SCALE_FACTOR` invalid; DPI factors must be either normal floats greater than 0, or `randr`. Got `{dpi_override}`", ); } dpi_override diff --git a/src/platform_impl/macos/app_state.rs b/src/platform_impl/macos/app_state.rs index 299ee790..1a85b40f 100644 --- a/src/platform_impl/macos/app_state.rs +++ b/src/platform_impl/macos/app_state.rs @@ -363,7 +363,7 @@ impl AppState { pub fn queue_event(wrapper: EventWrapper) { if !is_main_thread() { - panic!("Event queued from different thread: {:#?}", wrapper); + panic!("Event queued from different thread: {wrapper:#?}"); } HANDLER.events().push_back(wrapper); } diff --git a/src/platform_impl/macos/mod.rs b/src/platform_impl/macos/mod.rs index 378a8075..80bf8952 100644 --- a/src/platform_impl/macos/mod.rs +++ b/src/platform_impl/macos/mod.rs @@ -92,7 +92,7 @@ impl Window { impl fmt::Display for OsError { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { - OsError::CGError(e) => f.pad(&format!("CGError {}", e)), + OsError::CGError(e) => f.pad(&format!("CGError {e}")), OsError::CreationError(e) => f.pad(e), } } diff --git a/src/platform_impl/macos/monitor.rs b/src/platform_impl/macos/monitor.rs index 07ddfcaa..21250241 100644 --- a/src/platform_impl/macos/monitor.rs +++ b/src/platform_impl/macos/monitor.rs @@ -182,7 +182,7 @@ impl MonitorHandle { pub fn name(&self) -> Option { let MonitorHandle(display_id) = *self; let screen_num = CGDisplay::new(display_id).model_number(); - Some(format!("Monitor #{}", screen_num)) + Some(format!("Monitor #{screen_num}")) } #[inline] diff --git a/src/platform_impl/orbital/event_loop.rs b/src/platform_impl/orbital/event_loop.rs index 9df7dbd1..f0ad43d5 100644 --- a/src/platform_impl/orbital/event_loop.rs +++ b/src/platform_impl/orbital/event_loop.rs @@ -522,7 +522,7 @@ impl EventLoop { // Acknowledge the latest resize event. if let Some((w, h)) = event_state.resize_opt.take() { window - .write(format!("S,{},{}", w, h).as_bytes()) + .write(format!("S,{w},{h}").as_bytes()) .expect("failed to acknowledge resize"); // Require redraw after resize. diff --git a/src/platform_impl/orbital/mod.rs b/src/platform_impl/orbital/mod.rs index 7a8c1fea..97d1dc51 100644 --- a/src/platform_impl/orbital/mod.rs +++ b/src/platform_impl/orbital/mod.rs @@ -20,7 +20,7 @@ impl RedoxSocket { } fn orbital(properties: &WindowProperties<'_>) -> syscall::Result { - Self::open_raw(&format!("{}", properties)) + Self::open_raw(&format!("{properties}")) } // Paths should be checked to ensure they are actually sockets and not normal files. If a diff --git a/src/platform_impl/orbital/window.rs b/src/platform_impl/orbital/window.rs index eda103d9..da7d44be 100644 --- a/src/platform_impl/orbital/window.rs +++ b/src/platform_impl/orbital/window.rs @@ -187,7 +187,7 @@ impl Window { //TODO: adjust for window decorations let (x, y): (i32, i32) = position.to_physical::(self.scale_factor()).into(); self.window_socket - .write(format!("P,{},{}", x, y).as_bytes()) + .write(format!("P,{x},{y}").as_bytes()) .expect("failed to set position"); } @@ -206,7 +206,7 @@ impl Window { pub fn set_inner_size(&self, size: Size) { let (w, h): (u32, u32) = size.to_physical::(self.scale_factor()).into(); self.window_socket - .write(format!("S,{},{}", w, h).as_bytes()) + .write(format!("S,{w},{h}").as_bytes()) .expect("failed to set size"); } @@ -236,7 +236,7 @@ impl Window { #[inline] pub fn set_title(&self, title: &str) { self.window_socket - .write(format!("T,{}", title).as_bytes()) + .write(format!("T,{title}").as_bytes()) .expect("failed to set title"); } diff --git a/src/platform_impl/web/web_sys/canvas.rs b/src/platform_impl/web/web_sys/canvas.rs index 0c0693c6..1157a4f2 100644 --- a/src/platform_impl/web/web_sys/canvas.rs +++ b/src/platform_impl/web/web_sys/canvas.rs @@ -115,7 +115,7 @@ impl Canvas { self.common .raw .set_attribute(attribute, value) - .unwrap_or_else(|err| panic!("error: {:?}\nSet attribute: {}", err, attribute)) + .unwrap_or_else(|err| panic!("error: {err:?}\nSet attribute: {attribute}")) } pub fn position(&self) -> LogicalPosition { diff --git a/src/platform_impl/web/web_sys/mod.rs b/src/platform_impl/web/web_sys/mod.rs index 5e2d6c38..8dc25316 100644 --- a/src/platform_impl/web/web_sys/mod.rs +++ b/src/platform_impl/web/web_sys/mod.rs @@ -98,7 +98,7 @@ pub fn set_canvas_style_property(raw: &HtmlCanvasElement, property: &str, value: let style = raw.style(); style .set_property(property, value) - .unwrap_or_else(|err| panic!("error: {:?}\nFailed to set {}", err, property)) + .unwrap_or_else(|err| panic!("error: {err:?}\nFailed to set {property}")) } pub fn is_fullscreen(canvas: &HtmlCanvasElement) -> bool { diff --git a/src/platform_impl/windows/event_loop.rs b/src/platform_impl/windows/event_loop.rs index d3215f12..31d39d90 100644 --- a/src/platform_impl/windows/event_loop.rs +++ b/src/platform_impl/windows/event_loop.rs @@ -387,8 +387,7 @@ fn get_wait_thread_id() -> u32 { ); assert_eq!( msg.message, *SEND_WAIT_THREAD_ID_MSG_ID, - "this shouldn't be possible. please open an issue with Winit. error code: {}", - result + "this shouldn't be possible. please open an issue with Winit. error code: {result}" ); msg.lParam as u32 }