Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Nov 29, 2023
1 parent 9b34b2a commit 7def3ee
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 19 deletions.
2 changes: 1 addition & 1 deletion runtime/src/multi_window/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ where
match operation.finish() {
operation::Outcome::None => {}
operation::Outcome::Some(message) => {
self.queued_messages.push(message)
self.queued_messages.push(message);
}
operation::Outcome::Chain(next) => {
current_operation = Some(next);
Expand Down
7 changes: 4 additions & 3 deletions winit/src/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -720,9 +720,10 @@ pub fn run_command<A, C, E>(
let _res = window.drag_window();
}
window::Action::Spawn { .. } => {
log::info!(
"Spawning a window is only available with multi-window applications."
)
log::warn!(
"Spawning a window is only available with \
multi-window applications."
);
}
window::Action::Resize(size) => {
window.set_inner_size(winit::dpi::LogicalSize {
Expand Down
24 changes: 14 additions & 10 deletions winit/src/multi_window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ pub fn run_command<A, C, E>(
size.width,
size.height,
))))
.expect("Send message to event loop")
.expect("Send message to event loop");
}
window::Action::Maximize(maximized) => {
windows.with_raw(id).set_maximized(maximized);
Expand All @@ -934,7 +934,9 @@ pub fn run_command<A, C, E>(
));
}
window::Action::ChangeIcon(icon) => {
windows.with_raw(id).set_window_icon(conversion::icon(icon))
windows
.with_raw(id)
.set_window_icon(conversion::icon(icon));
}
window::Action::FetchMode(tag) => {
let window = windows.with_raw(id);
Expand Down Expand Up @@ -969,12 +971,14 @@ pub fn run_command<A, C, E>(
.with_raw(id)
.set_window_level(conversion::window_level(level));
}
window::Action::FetchId(tag) => proxy
.send_event(Event::Application(tag(windows
.with_raw(id)
.id()
.into())))
.expect("Event loop doesn't exist."),
window::Action::FetchId(tag) => {
proxy
.send_event(Event::Application(tag(windows
.with_raw(id)
.id()
.into())))
.expect("Event loop doesn't exist.");
}
window::Action::Screenshot(tag) => {
let i = windows.index_from_id(id);
let state = &windows.states[i];
Expand All @@ -996,7 +1000,7 @@ pub fn run_command<A, C, E>(
state.physical_size(),
),
)))
.expect("Event loop doesn't exist.")
.expect("Event loop doesn't exist.");
}
},
command::Action::System(action) => match action {
Expand All @@ -1014,7 +1018,7 @@ pub fn run_command<A, C, E>(

proxy
.send_event(Event::Application(message))
.expect("Event loop doesn't exist.")
.expect("Event loop doesn't exist.");
});
}
}
Expand Down
14 changes: 9 additions & 5 deletions winit/src/multi_window/windows.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use crate::core::{window, Size};
use crate::graphics::Compositor;
use crate::multi_window::{Application, State};
use iced_graphics::Compositor;
use iced_style::application::StyleSheet;
use std::fmt::{Debug, Formatter};
use crate::style::application::StyleSheet;

use winit::monitor::MonitorHandle;

use std::fmt::{Debug, Formatter};

pub struct Windows<A: Application, C: Compositor>
where
<A::Renderer as crate::core::Renderer>::Theme: StyleSheet,
Expand Down Expand Up @@ -33,7 +35,7 @@ where
&self
.raw
.iter()
.map(|raw| raw.id())
.map(winit::window::Window::id)
.collect::<Vec<winit::window::WindowId>>(),
)
.field("states", &self.states)
Expand Down Expand Up @@ -131,7 +133,9 @@ where
}

pub fn last_monitor(&self) -> Option<MonitorHandle> {
self.raw.last().and_then(|w| w.current_monitor())
self.raw
.last()
.and_then(winit::window::Window::current_monitor)
}

pub fn last(&self) -> usize {
Expand Down

0 comments on commit 7def3ee

Please sign in to comment.