Skip to content

Commit

Permalink
fix: clippy + fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Oct 6, 2024
1 parent 0db4294 commit 5e991e1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
11 changes: 5 additions & 6 deletions src-tauri/src/functionality/tray.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use std::{str::FromStr, sync::atomic::{AtomicUsize, Ordering}};
use std::{
str::FromStr,
sync::atomic::{AtomicUsize, Ordering},
};

use include_flate::flate;
use tauri::{
Expand Down Expand Up @@ -73,11 +76,7 @@ impl TrayIcon {

// Check if it makes sense for us to overwrite the tray icon (basically, "is the tray anything other than default/unread?")
pub fn is_overwrite(&self) -> bool {
match self {
TrayIcon::Default => true,
TrayIcon::Unread => true,
_ => false,
}
matches!(self, TrayIcon::Default | TrayIcon::Unread)
}
}

Expand Down
7 changes: 5 additions & 2 deletions src-tauri/src/util/notifications.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use std::sync::atomic::Ordering;

use crate::{functionality::tray::{set_tray_icon, TrayIcon, TRAY_STATE}, log};
use crate::{
functionality::tray::{set_tray_icon, TrayIcon, TRAY_STATE},
log,
};
use tauri::Manager;
use tauri_plugin_notification::NotificationExt;

Expand Down Expand Up @@ -73,7 +76,7 @@ pub fn notif_count(window: tauri::WebviewWindow, amount: i32) {
#[cfg(target_os = "linux")]
set_notif_icon(&window, amount);

// If the tray state is unread or default,
// If the tray state is unread or default,
if TrayIcon::from_usize(TRAY_STATE.load(Ordering::Relaxed)).is_overwrite() {
let state = if amount == 0 { "default" } else { "unread" };
set_tray_icon(window.app_handle().to_owned(), state.to_string());
Expand Down

0 comments on commit 5e991e1

Please sign in to comment.