mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-05-04 01:44:17 +02:00
chore(cargo): address clippy warnings
This commit is contained in:
@@ -723,7 +723,7 @@ impl Systray {
|
||||
.filter(|icon| icon.is_visible)
|
||||
.cloned()
|
||||
.collect();
|
||||
icons.sort_by(|a, b| a.stable_id.to_string().cmp(&b.stable_id.to_string()));
|
||||
icons.sort_by_key(|a| a.stable_id.to_string());
|
||||
icons
|
||||
}
|
||||
|
||||
@@ -731,7 +731,7 @@ impl Systray {
|
||||
fn get_all_icons() -> Vec<CachedIcon> {
|
||||
let state = SYSTRAY_STATE.lock();
|
||||
let mut icons: Vec<_> = state.icons.values().cloned().collect();
|
||||
icons.sort_by(|a, b| a.stable_id.to_string().cmp(&b.stable_id.to_string()));
|
||||
icons.sort_by_key(|a| a.stable_id.to_string());
|
||||
icons
|
||||
}
|
||||
|
||||
|
||||
@@ -307,12 +307,10 @@ impl Monitor {
|
||||
DefaultLayout::RightMainVerticalStack => {
|
||||
workspace.add_container_to_front(container);
|
||||
}
|
||||
DefaultLayout::UltrawideVerticalStack => {
|
||||
if workspace.containers().len() == 1 {
|
||||
workspace.insert_container_at_idx(0, container);
|
||||
} else {
|
||||
workspace.add_container_to_back(container);
|
||||
}
|
||||
DefaultLayout::UltrawideVerticalStack
|
||||
if workspace.containers().len() == 1 =>
|
||||
{
|
||||
workspace.insert_container_at_idx(0, container);
|
||||
}
|
||||
_ => {
|
||||
workspace.add_container_to_back(container);
|
||||
@@ -332,12 +330,10 @@ impl Monitor {
|
||||
|
||||
match layout {
|
||||
DefaultLayout::RightMainVerticalStack
|
||||
| DefaultLayout::UltrawideVerticalStack => {
|
||||
if workspace.containers().len() == 1 {
|
||||
workspace.add_container_to_back(container);
|
||||
} else {
|
||||
workspace.insert_container_at_idx(target_index, container);
|
||||
}
|
||||
| DefaultLayout::UltrawideVerticalStack
|
||||
if workspace.containers().len() == 1 =>
|
||||
{
|
||||
workspace.add_container_to_back(container);
|
||||
}
|
||||
_ => {
|
||||
workspace.insert_container_at_idx(target_index, container);
|
||||
|
||||
@@ -28,12 +28,10 @@ pub fn listen_for_movements(wm: Arc<Mutex<WindowManager>>) {
|
||||
Action::Press => ignore_movement = true,
|
||||
Action::Release => ignore_movement = false,
|
||||
},
|
||||
Event::MouseMoveRelative { .. } => {
|
||||
if !ignore_movement {
|
||||
match wm.lock().raise_window_at_cursor_pos() {
|
||||
Ok(()) => {}
|
||||
Err(error) => tracing::error!("{}", error),
|
||||
}
|
||||
Event::MouseMoveRelative { .. } if !ignore_movement => {
|
||||
match wm.lock().raise_window_at_cursor_pos() {
|
||||
Ok(()) => {}
|
||||
Err(error) => tracing::error!("{}", error),
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
|
||||
@@ -3376,7 +3376,7 @@ impl WindowManager {
|
||||
let rules: &mut Vec<(usize, Layout)> = &mut workspace.layout_rules;
|
||||
rules.retain(|pair| pair.0 != at_container_count);
|
||||
rules.push((at_container_count, Layout::Default(layout)));
|
||||
rules.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
rules.sort_by_key(|a| a.0);
|
||||
|
||||
// If this is the focused workspace on a non-focused screen, let's update it
|
||||
if focused_monitor_idx != monitor_idx && focused_workspace_idx == workspace_idx {
|
||||
@@ -3419,7 +3419,7 @@ impl WindowManager {
|
||||
let rules: &mut Vec<(usize, Layout)> = &mut workspace.layout_rules;
|
||||
rules.retain(|pair| pair.0 != at_container_count);
|
||||
rules.push((at_container_count, Layout::Custom(layout)));
|
||||
rules.sort_by(|a, b| a.0.cmp(&b.0));
|
||||
rules.sort_by_key(|a| a.0);
|
||||
|
||||
// If this is the focused workspace on a non-focused screen, let's update it
|
||||
if focused_monitor_idx != monitor_idx && focused_workspace_idx == workspace_idx {
|
||||
|
||||
@@ -1924,13 +1924,11 @@ fn main() -> eyre::Result<()> {
|
||||
"Application specific configuration file path has not been set. Try running 'komorebic fetch-asc'\n"
|
||||
);
|
||||
}
|
||||
Some(AppSpecificConfigurationPath::Single(path)) => {
|
||||
if !path.exists() {
|
||||
println!(
|
||||
"Application specific configuration file path '{}' does not exist. Try running 'komorebic fetch-asc'\n",
|
||||
path.display()
|
||||
);
|
||||
}
|
||||
Some(AppSpecificConfigurationPath::Single(path)) if !path.exists() => {
|
||||
println!(
|
||||
"Application specific configuration file path '{}' does not exist. Try running 'komorebic fetch-asc'\n",
|
||||
path.display()
|
||||
);
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user