mirror of
https://github.com/LGUG2Z/komorebi.git
synced 2026-07-12 08:02:40 +02:00
chore(cargo): address clippy warnings
This commit is contained in:
@@ -723,7 +723,7 @@ impl Systray {
|
|||||||
.filter(|icon| icon.is_visible)
|
.filter(|icon| icon.is_visible)
|
||||||
.cloned()
|
.cloned()
|
||||||
.collect();
|
.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
|
icons
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -731,7 +731,7 @@ impl Systray {
|
|||||||
fn get_all_icons() -> Vec<CachedIcon> {
|
fn get_all_icons() -> Vec<CachedIcon> {
|
||||||
let state = SYSTRAY_STATE.lock();
|
let state = SYSTRAY_STATE.lock();
|
||||||
let mut icons: Vec<_> = state.icons.values().cloned().collect();
|
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
|
icons
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+8
-12
@@ -307,12 +307,10 @@ impl Monitor {
|
|||||||
DefaultLayout::RightMainVerticalStack => {
|
DefaultLayout::RightMainVerticalStack => {
|
||||||
workspace.add_container_to_front(container);
|
workspace.add_container_to_front(container);
|
||||||
}
|
}
|
||||||
DefaultLayout::UltrawideVerticalStack => {
|
DefaultLayout::UltrawideVerticalStack
|
||||||
if workspace.containers().len() == 1 {
|
if workspace.containers().len() == 1 =>
|
||||||
workspace.insert_container_at_idx(0, container);
|
{
|
||||||
} else {
|
workspace.insert_container_at_idx(0, container);
|
||||||
workspace.add_container_to_back(container);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
workspace.add_container_to_back(container);
|
workspace.add_container_to_back(container);
|
||||||
@@ -332,12 +330,10 @@ impl Monitor {
|
|||||||
|
|
||||||
match layout {
|
match layout {
|
||||||
DefaultLayout::RightMainVerticalStack
|
DefaultLayout::RightMainVerticalStack
|
||||||
| DefaultLayout::UltrawideVerticalStack => {
|
| DefaultLayout::UltrawideVerticalStack
|
||||||
if workspace.containers().len() == 1 {
|
if workspace.containers().len() == 1 =>
|
||||||
workspace.add_container_to_back(container);
|
{
|
||||||
} else {
|
workspace.add_container_to_back(container);
|
||||||
workspace.insert_container_at_idx(target_index, container);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
workspace.insert_container_at_idx(target_index, 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::Press => ignore_movement = true,
|
||||||
Action::Release => ignore_movement = false,
|
Action::Release => ignore_movement = false,
|
||||||
},
|
},
|
||||||
Event::MouseMoveRelative { .. } => {
|
Event::MouseMoveRelative { .. } if !ignore_movement => {
|
||||||
if !ignore_movement {
|
match wm.lock().raise_window_at_cursor_pos() {
|
||||||
match wm.lock().raise_window_at_cursor_pos() {
|
Ok(()) => {}
|
||||||
Ok(()) => {}
|
Err(error) => tracing::error!("{}", error),
|
||||||
Err(error) => tracing::error!("{}", error),
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
|
|||||||
@@ -3376,7 +3376,7 @@ impl WindowManager {
|
|||||||
let rules: &mut Vec<(usize, Layout)> = &mut workspace.layout_rules;
|
let rules: &mut Vec<(usize, Layout)> = &mut workspace.layout_rules;
|
||||||
rules.retain(|pair| pair.0 != at_container_count);
|
rules.retain(|pair| pair.0 != at_container_count);
|
||||||
rules.push((at_container_count, Layout::Default(layout)));
|
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 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 {
|
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;
|
let rules: &mut Vec<(usize, Layout)> = &mut workspace.layout_rules;
|
||||||
rules.retain(|pair| pair.0 != at_container_count);
|
rules.retain(|pair| pair.0 != at_container_count);
|
||||||
rules.push((at_container_count, Layout::Custom(layout)));
|
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 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 {
|
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"
|
"Application specific configuration file path has not been set. Try running 'komorebic fetch-asc'\n"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
Some(AppSpecificConfigurationPath::Single(path)) => {
|
Some(AppSpecificConfigurationPath::Single(path)) if !path.exists() => {
|
||||||
if !path.exists() {
|
println!(
|
||||||
println!(
|
"Application specific configuration file path '{}' does not exist. Try running 'komorebic fetch-asc'\n",
|
||||||
"Application specific configuration file path '{}' does not exist. Try running 'komorebic fetch-asc'\n",
|
path.display()
|
||||||
path.display()
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user