Skip to content

Commit

Permalink
fix: clippy + fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Sep 19, 2024
1 parent 41e54a9 commit 9546afd
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
6 changes: 5 additions & 1 deletion src-tauri/src/functionality/cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ pub fn clear_cache() {

let date = NSDate::dateWithTimeIntervalSince1970(0.0);

store.removeDataOfTypes_modifiedSince_completionHandler(&data_types, &date, &StackBlock::new(|| {}));
store.removeDataOfTypes_modifiedSince_completionHandler(
&data_types,
&date,
&StackBlock::new(|| {}),
);
pool.drain();
}
}
Expand Down
4 changes: 1 addition & 3 deletions src-tauri/src/functionality/extension.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ use crate::{log, util::paths::get_extensions_dir};
#[cfg(target_os = "windows")]
pub fn add_extension(win: &WebviewWindow, path: PathBuf) {
use webview2_com::{
Microsoft::Web::WebView2::Win32::{
ICoreWebView2Profile7, ICoreWebView2_13,
},
Microsoft::Web::WebView2::Win32::{ICoreWebView2Profile7, ICoreWebView2_13},
ProfileAddBrowserExtensionCompletedHandler,
};
use windows::core::{Interface, HSTRING};
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/util/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub fn get_os_accent() -> String {

#[cfg(target_os = "macos")]
pub fn get_os_accent() -> String {
use objc2_foundation::{NSUserDefaults, NSString};
use objc2_foundation::{NSString, NSUserDefaults};

// From https://github.com/tauri-apps/tao/pull/589
unsafe {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/util/notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ pub unsafe fn set_notif_icon(window: &tauri::WebviewWindow, amount: i32) {
// https://github.com/tauri-apps/tauri/issues/4489#issuecomment-1170050529
#[cfg(target_os = "macos")]
pub unsafe fn set_notif_icon(_: &tauri::WebviewWindow, amount: i32) {
use objc2_foundation::{MainThreadMarker, NSString};
use objc2_app_kit::NSApp;
use objc2_foundation::{MainThreadMarker, NSString};

let label = if amount > 0 {
Some(NSString::from_str(&format!("{}", amount)))
Expand Down
10 changes: 4 additions & 6 deletions src-tauri/src/util/window_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,11 @@ pub fn set_user_agent(win: &tauri::WebviewWindow) {
use objc2_web_kit::WKWebView;

win
.with_webview(|webview| {
unsafe {
let webview: &WKWebView = &*webview.inner().cast();
let useragent = NSString::from_str(USERAGENT);
.with_webview(|webview| unsafe {
let webview: &WKWebView = &*webview.inner().cast();
let useragent = NSString::from_str(USERAGENT);

webview.setCustomUserAgent(Some(&useragent));
}
webview.setCustomUserAgent(Some(&useragent));
})
.expect("Failed to set user agent!");
}

0 comments on commit 9546afd

Please sign in to comment.