Skip to content

Commit 56b6d65

Browse files
committed
cleanup: formatting and clippy
1 parent 4521d6e commit 56b6d65

File tree

11 files changed

+14
-36
lines changed

11 files changed

+14
-36
lines changed

examples/integration/src/controls.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ impl Program for Controls {
4646
Command::none()
4747
}
4848

49-
fn view(&self, _: Id) -> Element<Message, Renderer<Theme>> {
49+
fn view(&self) -> Element<Message, Renderer<Theme>> {
5050
let background_color = self.background_color;
5151
let text = &self.text;
5252

examples/integration/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
154154
);
155155

156156
let mut state = program::State::new(
157-
Id(0),
157+
Id::MAIN,
158158
controls,
159159
viewport.logical_size(),
160160
&mut renderer,
@@ -199,7 +199,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
199199
if !state.is_queue_empty() {
200200
// We update iced
201201
let _ = state.update(
202-
Id(0),
202+
Id::MAIN,
203203
viewport.logical_size(),
204204
cursor_position
205205
.map(|p| {

examples/sctk_todos/src/main.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
use env_logger::Env;
22
use iced::alignment::{self, Alignment};
33
use iced::event::{self, listen_raw, Event};
4-
use iced::subscription;
54
use iced::theme::{self, Theme};
6-
use iced::wayland::actions::data_device::ActionInner;
75
use iced::wayland::actions::window::SctkWindowSettings;
8-
use iced::wayland::data_device::action as data_device_action;
96
use iced::wayland::InitialSurface;
107
use iced::widget::{
118
self, button, checkbox, column, container, row, scrollable, text,
@@ -20,7 +17,6 @@ use iced_core::{id, keyboard};
2017
use once_cell::sync::Lazy;
2118
use serde::{Deserialize, Serialize};
2219
use std::fmt::Debug;
23-
use std::sync::Arc;
2420

2521
static INPUT_ID: Lazy<Id> = Lazy::new(Id::unique);
2622

runtime/src/program/state.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ where
275275
}
276276

277277
fn build_user_interface<'a, P: Program>(
278-
id: crate::window::Id,
278+
_id: crate::window::Id,
279279
program: &'a mut P,
280280
cache: user_interface::Cache,
281281
renderer: &mut P::Renderer,

src/application.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
//! Build interactive cross-platform applications.
2-
use iced_core::window::Id;
32
43
use crate::{Command, Element, Executor, Settings, Subscription};
54

src/wayland/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub trait Application: Sized {
6060
/// Returns the current [`Theme`] of the [`Application`].
6161
///
6262
/// [`Theme`]: Self::Theme
63-
fn theme(&self, id: Id) -> Self::Theme {
63+
fn theme(&self, _id: Id) -> Self::Theme {
6464
Self::Theme::default()
6565
}
6666

@@ -98,7 +98,7 @@ pub trait Application: Sized {
9898
/// while a scale factor of `0.5` will shrink them to half their size.
9999
///
100100
/// By default, it returns `1.0`.
101-
fn scale_factor(&self, id: Id) -> f64 {
101+
fn scale_factor(&self, _id: Id) -> f64 {
102102
1.0
103103
}
104104

src/wayland/sandbox.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ use crate::{
8181
/// fn view(&self, _: Id) -> Element<Self::Message> {
8282
/// "Hello, world!".into()
8383
/// }
84-
///
85-
/// fn close_requested(&self, _: Id) -> Self::Message {
86-
/// unimplemented!()
87-
/// }
8884
/// }
8985
/// ```
9086
pub trait Sandbox {

tiny_skia/src/window/compositor.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,10 @@ pub fn present<T: AsRef<str>>(
183183
surface
184184
.window
185185
.resize(
186-
NonZeroU32::new(physical_size.width as u32)
187-
.ok_or_else(|| compositor::SurfaceError::InvalidDimensions)?,
188-
NonZeroU32::new(physical_size.height as u32)
189-
.ok_or_else(|| compositor::SurfaceError::InvalidDimensions)?,
186+
NonZeroU32::new(physical_size.width)
187+
.ok_or(compositor::SurfaceError::InvalidDimensions)?,
188+
NonZeroU32::new(physical_size.height)
189+
.ok_or(compositor::SurfaceError::InvalidDimensions)?,
190190
)
191191
.map_err(|_| compositor::SurfaceError::Resize)?;
192192
if let Ok(mut b) = surface.window.buffer_mut() {

winit/src/application.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
//! Create interactive, native cross-platform applications.
22
mod drag_resize;
3-
#[cfg(feature = "trace")]
4-
mod profiler;
53
mod state;
64

75
#[cfg(feature = "a11y")]
@@ -918,14 +916,10 @@ pub fn run_command<A, C, E>(
918916
for action in command.actions() {
919917
match action {
920918
command::Action::Future(future) => {
921-
runtime.spawn(Box::pin(
922-
future.map(|e| UserEventWrapper::Message(e)),
923-
));
919+
runtime.spawn(Box::pin(future.map(UserEventWrapper::Message)));
924920
}
925921
command::Action::Stream(stream) => {
926-
runtime.run(Box::pin(
927-
stream.map(|e| UserEventWrapper::Message(e)),
928-
));
922+
runtime.run(Box::pin(stream.map(UserEventWrapper::Message)));
929923
}
930924
command::Action::Clipboard(action) => match action {
931925
clipboard::Action::Read(tag) => {

winit/src/conversion.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,9 +160,6 @@ pub fn window_event(
160160
WindowEvent::CloseRequested => {
161161
Some(Event::Window(id, window::Event::CloseRequested))
162162
}
163-
WindowEvent::CloseRequested => {
164-
Some(Event::Window(id, window::Event::CloseRequested))
165-
}
166163
WindowEvent::CursorMoved { position, .. } => {
167164
let position = position.to_logical::<f64>(scale_factor);
168165

0 commit comments

Comments
 (0)