refactor(clippy): apply various lint fixes

This commit is contained in:
LGUG2Z
2022-11-13 15:31:19 -08:00
parent b010215318
commit 37edbcfebc
6 changed files with 45 additions and 51 deletions

View File

@@ -131,7 +131,7 @@ impl ApplicationConfigurationGenerator {
String::from("; Generated by komorebic.exe"),
String::from("; To use this file, add the line below to the top of your komorebi.ahk configuration file"),
String::from("; #Include %A_ScriptDir%\\komorebi.generated.ahk"),
String::from("")
String::new()
];
let mut float_rules = vec![];
@@ -168,7 +168,7 @@ impl ApplicationConfigurationGenerator {
}
}
lines.push(String::from(""));
lines.push(String::new());
}
Ok(lines)

View File

@@ -229,16 +229,13 @@ impl Direction for CustomLayout {
}
let (column_idx, column) = self.column_with_idx(idx);
match column {
None => false,
Some(column) => match column {
Column::Secondary(Some(ColumnSplitWithCapacity::Horizontal(_)))
| Column::Tertiary(ColumnSplit::Horizontal) => {
self.column_for_container_idx(idx - 1) == column_idx
}
_ => false,
},
}
column.map_or(false, |column| match column {
Column::Secondary(Some(ColumnSplitWithCapacity::Horizontal(_)))
| Column::Tertiary(ColumnSplit::Horizontal) => {
self.column_for_container_idx(idx - 1) == column_idx
}
_ => false,
})
}
OperationDirection::Down => {
if idx == count - 1 {
@@ -246,16 +243,13 @@ impl Direction for CustomLayout {
}
let (column_idx, column) = self.column_with_idx(idx);
match column {
None => false,
Some(column) => match column {
Column::Secondary(Some(ColumnSplitWithCapacity::Horizontal(_)))
| Column::Tertiary(ColumnSplit::Horizontal) => {
self.column_for_container_idx(idx + 1) == column_idx
}
_ => false,
},
}
column.map_or(false, |column| match column {
Column::Secondary(Some(ColumnSplitWithCapacity::Horizontal(_)))
| Column::Tertiary(ColumnSplit::Horizontal) => {
self.column_for_container_idx(idx + 1) == column_idx
}
_ => false,
})
}
}
}