Skip to content

Commit

Permalink
chore(clippy): apply new rust 1.84.0 lints
Browse files Browse the repository at this point in the history
  • Loading branch information
LGUG2Z committed Jan 9, 2025
1 parent c71e61f commit 996a556
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion komorebi-bar/src/bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ impl Komobar {
Some(widget.komorebi_notification_state.clone());
}
Some(ref previous) => {
if widget.workspaces.map_or(false, |w| w.enable) {
if widget.workspaces.is_some_and(|w| w.enable) {
previous.borrow_mut().update_from_config(
&widget.komorebi_notification_state.borrow(),
);
Expand Down
8 changes: 4 additions & 4 deletions komorebi-bar/src/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,13 @@ impl WidgetConfig {
WidgetConfig::Cpu(config) => config.enable,
WidgetConfig::Date(config) => config.enable,
WidgetConfig::Komorebi(config) => {
config.workspaces.as_ref().map_or(false, |w| w.enable)
|| config.layout.as_ref().map_or(false, |w| w.enable)
|| config.focused_window.as_ref().map_or(false, |w| w.enable)
config.workspaces.as_ref().is_some_and(|w| w.enable)
|| config.layout.as_ref().is_some_and(|w| w.enable)
|| config.focused_window.as_ref().is_some_and(|w| w.enable)
|| config
.configuration_switcher
.as_ref()
.map_or(false, |w| w.enable)
.is_some_and(|w| w.enable)
}
WidgetConfig::Media(config) => config.enable,
WidgetConfig::Memory(config) => config.enable,
Expand Down
4 changes: 2 additions & 2 deletions komorebi/src/core/direction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ impl Direction for CustomLayout {
}

let (column_idx, column) = self.column_with_idx(idx);
column.map_or(false, |column| match column {
column.is_some_and(|column| match column {
Column::Secondary(Some(ColumnSplitWithCapacity::Horizontal(_)))
| Column::Tertiary(ColumnSplit::Horizontal) => {
self.column_for_container_idx(idx - 1) == column_idx
Expand All @@ -420,7 +420,7 @@ impl Direction for CustomLayout {
}

let (column_idx, column) = self.column_with_idx(idx);
column.map_or(false, |column| match column {
column.is_some_and(|column| match column {
Column::Secondary(Some(ColumnSplitWithCapacity::Horizontal(_)))
| Column::Tertiary(ColumnSplit::Horizontal) => {
self.column_for_container_idx(idx + 1) == column_idx
Expand Down

0 comments on commit 996a556

Please sign in to comment.