cargo fmt

This commit is contained in:
Skia 2023-11-13 15:42:25 +01:00
parent 6d26286583
commit 6d8c19e8a7

View file

@ -283,7 +283,10 @@ fn move_container_to_workspace_absolute(stream: &UnixStream, workspace_index: us
let group_index = (workspace_index / MAX_GROUP_WS) as usize; let group_index = (workspace_index / MAX_GROUP_WS) as usize;
let outputs = get_outputs(stream); let outputs = get_outputs(stream);
let workspaces = get_workspaces(stream); let workspaces = get_workspaces(stream);
let full_ws_name = format!("{}", group_index * MAX_GROUP_WS + workspace_index % MAX_GROUP_WS); let full_ws_name = format!(
"{}",
group_index * MAX_GROUP_WS + workspace_index % MAX_GROUP_WS
);
// If the workspace already exists // If the workspace already exists
match workspaces.iter().find(|w| w.num == workspace_index) { match workspaces.iter().find(|w| w.num == workspace_index) {
@ -294,7 +297,10 @@ fn move_container_to_workspace_absolute(stream: &UnixStream, workspace_index: us
} }
None => { None => {
let target_group = workspace_index / MAX_GROUP_WS; let target_group = workspace_index / MAX_GROUP_WS;
let target_screen_index = match workspaces.iter().find(|w| w.num / MAX_GROUP_WS == target_group) { let target_screen_index = match workspaces
.iter()
.find(|w| w.num / MAX_GROUP_WS == target_group)
{
// If other workspaces on the same group exists // If other workspaces on the same group exists
Some(other_workspace) => Some( Some(other_workspace) => Some(
outputs outputs
@ -400,7 +406,10 @@ fn focus_to_workspace_absolute(stream: &UnixStream, workspace_index: usize) {
} }
None => { None => {
let target_group = workspace_index / MAX_GROUP_WS; let target_group = workspace_index / MAX_GROUP_WS;
let target_screen_index = match workspaces.iter().find(|w| w.num / MAX_GROUP_WS == target_group) { let target_screen_index = match workspaces
.iter()
.find(|w| w.num / MAX_GROUP_WS == target_group)
{
// If other workspaces on the same group exists // If other workspaces on the same group exists
Some(other_workspace) => Some( Some(other_workspace) => Some(
outputs outputs
@ -457,7 +466,10 @@ fn focus_to_group(stream: &UnixStream, group_index: usize) {
let target_workspace_relative_index = current_workspace_index % MAX_GROUP_WS; let target_workspace_relative_index = current_workspace_index % MAX_GROUP_WS;
let target_workspace_index = group_index * MAX_GROUP_WS + target_workspace_relative_index; let target_workspace_index = group_index * MAX_GROUP_WS + target_workspace_relative_index;
let full_ws_name = format!("{}", group_index * MAX_GROUP_WS + target_workspace_relative_index); let full_ws_name = format!(
"{}",
group_index * MAX_GROUP_WS + target_workspace_relative_index
);
// If the workspace already exists // If the workspace already exists
match workspaces.iter().find(|w| w.num == target_workspace_index) { match workspaces.iter().find(|w| w.num == target_workspace_index) {
@ -467,7 +479,10 @@ fn focus_to_group(stream: &UnixStream, group_index: usize) {
send_command(stream, &focus_cmd); send_command(stream, &focus_cmd);
} }
None => { None => {
let target_screen_index = match workspaces.iter().find(|w| w.num / MAX_GROUP_WS == group_index) { let target_screen_index = match workspaces
.iter()
.find(|w| w.num / MAX_GROUP_WS == group_index)
{
// If other workspaces on the same group exists // If other workspaces on the same group exists
Some(other_workspace) => Some( Some(other_workspace) => Some(
outputs outputs
@ -550,7 +565,10 @@ fn move_container_to_next_or_prev_output(stream: &UnixStream, go_to_prev: bool)
.find(|x| x.output == target_output.name && x.visible) .find(|x| x.output == target_output.name && x.visible)
.unwrap(); .unwrap();
let group_index = (target_workspace.num / MAX_GROUP_WS) as usize; let group_index = (target_workspace.num / MAX_GROUP_WS) as usize;
let full_ws_name = format!("{}", group_index * MAX_GROUP_WS + target_workspace.num % MAX_GROUP_WS); let full_ws_name = format!(
"{}",
group_index * MAX_GROUP_WS + target_workspace.num % MAX_GROUP_WS
);
// Move container to target workspace // Move container to target workspace
let mut cmd: String = "move container to workspace number ".to_string(); let mut cmd: String = "move container to workspace number ".to_string();