Skip to content

Commit a965029

Browse files
SuchAFuriousDeathkjarosh
authored andcommitted
chore: Utilize let chains to appease Clippy
1 parent 70a5700 commit a965029

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

desktop/src/backends/ui.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,9 @@ impl UiBackend for DesktopUiBackend {
361361
let mut dialog = AsyncFileDialog::new();
362362

363363
for filter in filters {
364-
if cfg!(target_os = "macos") && filter.mac_type.is_some() {
365-
let mac_type = filter.mac_type.expect("Checked above");
364+
if cfg!(target_os = "macos")
365+
&& let Some(mac_type) = filter.mac_type
366+
{
366367
let extensions: Vec<&str> = mac_type.split(';').collect();
367368
dialog = dialog.add_filter(&filter.description, &extensions);
368369
} else {

web/src/ui.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,8 +365,9 @@ impl UiBackend for WebUiBackend {
365365
let navigator = window.navigator();
366366
let platform = navigator.platform().expect("navigator.platform");
367367

368-
if platform.contains("Mac") && filter.mac_type.is_some() {
369-
let mac_type = filter.mac_type.expect("Cant fail");
368+
if platform.contains("Mac")
369+
&& let Some(mac_type) = filter.mac_type
370+
{
370371
let extensions: Vec<&str> = mac_type.split(';').collect();
371372
dialog = dialog.add_filter(&filter.description, &extensions);
372373
} else {

0 commit comments

Comments
 (0)