chore: clippy
This commit is contained in:
parent
3b70bc0265
commit
0847247c33
77 changed files with 865 additions and 1029 deletions
|
|
@ -51,9 +51,7 @@ fn next_workspace(
|
|||
shell
|
||||
.workspaces
|
||||
.spaces_for_output(&output)
|
||||
.skip_while(|space| space.handle != current_handle)
|
||||
.skip(1)
|
||||
.next()
|
||||
.skip_while(|space| space.handle != current_handle).nth(1)
|
||||
.map(|space| (current_handle, space.handle))
|
||||
}
|
||||
|
||||
|
|
@ -62,7 +60,7 @@ fn move_fullscreen_prev_workspace(state: &mut State, surface: &CosmicSurface) {
|
|||
let Some(wl_surface) = surface.wl_surface() else {
|
||||
return;
|
||||
};
|
||||
let Some((from, to)) = prev_workspace(&shell, &*wl_surface) else {
|
||||
let Some((from, to)) = prev_workspace(&shell, &wl_surface) else {
|
||||
return;
|
||||
};
|
||||
|
||||
|
|
@ -88,7 +86,7 @@ fn move_fullscreen_next_workspace(state: &mut State, surface: &CosmicSurface) {
|
|||
let Some(wl_surface) = surface.wl_surface() else {
|
||||
return;
|
||||
};
|
||||
let Some((from, to)) = next_workspace(&shell, &*wl_surface) else {
|
||||
let Some((from, to)) = next_workspace(&shell, &wl_surface) else {
|
||||
return;
|
||||
};
|
||||
|
||||
|
|
@ -115,7 +113,7 @@ fn move_element_prev_workspace(state: &mut State, mapped: &CosmicMapped) {
|
|||
let Some(wl_surface) = window.wl_surface() else {
|
||||
return;
|
||||
};
|
||||
let Some((from, to)) = prev_workspace(&shell, &*wl_surface) else {
|
||||
let Some((from, to)) = prev_workspace(&shell, &wl_surface) else {
|
||||
return;
|
||||
};
|
||||
|
||||
|
|
@ -141,7 +139,7 @@ fn move_element_next_workspace(state: &mut State, mapped: &CosmicMapped) {
|
|||
let Some(wl_surface) = window.wl_surface() else {
|
||||
return;
|
||||
};
|
||||
let Some((from, to)) = next_workspace(&shell, &*wl_surface) else {
|
||||
let Some((from, to)) = next_workspace(&shell, &wl_surface) else {
|
||||
return;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ struct State {
|
|||
cursor_over: bool,
|
||||
}
|
||||
|
||||
impl<'a, Message> Widget<Message, cosmic::Theme, cosmic::Renderer> for SubmenuItem<'a, Message>
|
||||
impl<Message> Widget<Message, cosmic::Theme, cosmic::Renderer> for SubmenuItem<'_, Message>
|
||||
where
|
||||
Message: CursorEvents,
|
||||
{
|
||||
|
|
@ -216,11 +216,11 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<'a, Message> Into<cosmic::Element<'a, Message>> for SubmenuItem<'a, Message>
|
||||
impl<'a, Message> From<SubmenuItem<'a, Message>> for cosmic::Element<'a, Message>
|
||||
where
|
||||
Message: CursorEvents + 'a,
|
||||
{
|
||||
fn into(self) -> cosmic::Element<'a, Message> {
|
||||
Element::new(self)
|
||||
fn from(val: SubmenuItem<'a, Message>) -> Self {
|
||||
Element::new(val)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -381,7 +381,7 @@ impl Program for ContextMenu {
|
|||
.row_width
|
||||
.lock()
|
||||
.unwrap()
|
||||
.map(|size| Length::Fixed(size))
|
||||
.map(Length::Fixed)
|
||||
.unwrap_or(Length::Shrink);
|
||||
let mode = match width {
|
||||
Length::Shrink => Length::Shrink,
|
||||
|
|
@ -968,8 +968,7 @@ impl MenuAlignment {
|
|||
size,
|
||||
AxisAlignment::Centered,
|
||||
AxisAlignment::Corner(0),
|
||||
)
|
||||
.into_iter(),
|
||||
),
|
||||
)
|
||||
.chain(
|
||||
for_alignment(
|
||||
|
|
@ -977,8 +976,7 @@ impl MenuAlignment {
|
|||
size,
|
||||
AxisAlignment::Corner(0),
|
||||
AxisAlignment::Centered,
|
||||
)
|
||||
.into_iter(),
|
||||
),
|
||||
)
|
||||
.chain(
|
||||
for_alignment(
|
||||
|
|
@ -986,15 +984,14 @@ impl MenuAlignment {
|
|||
size,
|
||||
AxisAlignment::Corner(0),
|
||||
AxisAlignment::Corner(0),
|
||||
)
|
||||
.into_iter(),
|
||||
),
|
||||
)
|
||||
.collect(),
|
||||
(AxisAlignment::PreferCentered, y) => {
|
||||
for_alignment(position, size, AxisAlignment::Centered, y)
|
||||
.into_iter()
|
||||
.chain(
|
||||
for_alignment(position, size, AxisAlignment::Corner(0), y).into_iter(),
|
||||
for_alignment(position, size, AxisAlignment::Corner(0), y),
|
||||
)
|
||||
.collect()
|
||||
}
|
||||
|
|
@ -1002,7 +999,7 @@ impl MenuAlignment {
|
|||
for_alignment(position, size, x, AxisAlignment::Centered)
|
||||
.into_iter()
|
||||
.chain(
|
||||
for_alignment(position, size, x, AxisAlignment::Corner(0)).into_iter(),
|
||||
for_alignment(position, size, x, AxisAlignment::Corner(0)),
|
||||
)
|
||||
.collect()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue