From ae38853233ccc9d079c40344cf14482b1f441fa0 Mon Sep 17 00:00:00 2001 From: Jai A Date: Wed, 28 Aug 2024 20:04:56 -0700 Subject: [PATCH] fix clippy --- apps/app/src/api/ads.rs | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/apps/app/src/api/ads.rs b/apps/app/src/api/ads.rs index 773807a5c..427c2ecfd 100644 --- a/apps/app/src/api/ads.rs +++ b/apps/app/src/api/ads.rs @@ -31,25 +31,23 @@ pub async fn init_ads_window( if let Some(webview) = app.webviews().get("ads-window") { let _ = webview.set_position(LogicalPosition::new(x, y)); let _ = webview.set_size(LogicalSize::new(width, height)); - } else { - if let Some(window) = app.get_window("main") { - let _ = window.add_child( - tauri::webview::WebviewBuilder::new( - "ads-window", - WebviewUrl::External( - "http://localhost:3000/promo-frame.html" - .parse() - .unwrap(), - ), - ) - .initialization_script(LINK_SCRIPT) - .user_agent("ModrinthApp Ads Webview") - .zoom_hotkeys_enabled(false) - .transparent(true), - LogicalPosition::new(x, y), - LogicalSize::new(width, height), - ); - } + } else if let Some(window) = app.get_window("main") { + let _ = window.add_child( + tauri::webview::WebviewBuilder::new( + "ads-window", + WebviewUrl::External( + "http://localhost:3000/promo-frame.html" + .parse() + .unwrap(), + ), + ) + .initialization_script(LINK_SCRIPT) + .user_agent("ModrinthApp Ads Webview") + .zoom_hotkeys_enabled(false) + .transparent(true), + LogicalPosition::new(x, y), + LogicalSize::new(width, height), + ); } }