From 29c5e6bd1d17b1ec237c3435928339a01560e5bf Mon Sep 17 00:00:00 2001 From: Markus Krause Date: Tue, 31 Dec 2024 00:55:33 +0100 Subject: [PATCH] lint updates --- src/app.rs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/app.rs b/src/app.rs index 4c81e65..694d889 100644 --- a/src/app.rs +++ b/src/app.rs @@ -219,7 +219,7 @@ impl MyApp { } } // if we fall through to here, we failed getting data somewhere along the way - return None; + None } } @@ -255,10 +255,8 @@ impl eframe::App for MyApp { if ui.button("Settings").clicked() { self.settings_open = true; } - if !is_web { - if ui.button("Quit").clicked() { - ctx.send_viewport_cmd(egui::ViewportCommand::Close); - } + if !is_web && ui.button("Quit").clicked() { + ctx.send_viewport_cmd(egui::ViewportCommand::Close); } }); ui.add_space(16.0); @@ -352,7 +350,7 @@ impl eframe::App for MyApp { // https://datasheet.lcsc.com/lcsc/2206010216_UNI-ROYAL-Uniroyal-Elec-0402WGF1001TCE_C11702.pdf // https://wmsc.lcsc.com/wmsc/upload/file/pdf/v2/lcsc/2206010216_UNI-ROYAL-Uniroyal-Elec-0402WGF1001TCE_C11702.pdf let dl = Downloader::builder() - .download_folder(&dlpath) + .download_folder(dlpath) .build() .ok(); let pdf_url = url.replace("https://datasheet.lcsc.com/lcsc", "https://wmsc.lcsc.com/wmsc/upload/file/pdf/v2/lcsc"); @@ -397,14 +395,11 @@ impl eframe::App for MyApp { for p in paths { match p { Ok(path) => { - if let Some(mut clipboard) = - Clipboard::new().ok() + if let Ok(mut clipboard) = Clipboard::new() { - if let Some(contents) = - read_to_string(path).ok() + if let Ok(contents) = read_to_string(path) { - let _ = - clipboard.set_text(contents); + let _ = clipboard.set_text(contents); } } }