Skip to content

Commit

Permalink
macos: Fix random clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
PolyMeilex committed Nov 23, 2024
1 parent 0177c1e commit 2787c56
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/backend/macos/file_dialog/panel_ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ trait PanelExt {
exts.append(&mut filter.extensions.to_vec());
}

let f_raw: Vec<_> = exts.iter().map(|ext| NSString::from_str(&ext)).collect();
let f_raw: Vec<_> = exts.iter().map(|ext| NSString::from_str(ext)).collect();
let array = NSArray::from_vec(f_raw);

unsafe {
Expand Down Expand Up @@ -175,7 +175,7 @@ impl Panel {
let panel = unsafe { NSOpenPanel::openPanel(mtm) };

if !opt.filters.is_empty() {
panel.add_filters(&opt);
panel.add_filters(opt);
}

if let Some(path) = &opt.starting_directory {
Expand Down Expand Up @@ -204,7 +204,7 @@ impl Panel {
let panel = unsafe { NSSavePanel::savePanel(mtm) };

if !opt.filters.is_empty() {
panel.add_filters(&opt);
panel.add_filters(opt);
}

if let Some(path) = &opt.starting_directory {
Expand Down Expand Up @@ -271,7 +271,7 @@ impl Panel {
let panel = unsafe { NSOpenPanel::openPanel(mtm) };

if !opt.filters.is_empty() {
panel.add_filters(&opt);
panel.add_filters(opt);
}

if let Some(path) = &opt.starting_directory {
Expand Down
2 changes: 1 addition & 1 deletion src/backend/macos/modal_future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl<R: 'static + Default, D: AsModal + 'static> ModalFuture<R, D> {
let mut state = state.lock().unwrap();
// take() to drop it when it's safe to do so
state.data = if let Some(mut modal) = state.modal.take() {
Some((&cb)(&mut modal, result))
Some((cb)(&mut modal, result))
} else {
Some(Default::default())
};
Expand Down
2 changes: 1 addition & 1 deletion src/backend/macos/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub fn run_on_main<R: Send, F: FnOnce(MainThreadMarker) -> R + Send>(run: F) ->
let mtm = unsafe { MainThreadMarker::new_unchecked() };
let app = NSApplication::sharedApplication(mtm);
if unsafe { app.isRunning() } {
objc2_foundation::run_on_main(|mtm| run(mtm))
objc2_foundation::run_on_main(run)
} else {
panic!("You are running RFD in NonWindowed environment, it is impossible to spawn dialog from thread different than main in this env.");
}
Expand Down
4 changes: 2 additions & 2 deletions src/backend/macos/utils/user_alert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@ impl UserAlert {
alternate_button_title: buttons[1].take(),
other_button_title: buttons[2].take(),
buttons: opt.buttons,
_policy_manager: mtm.map(|mtm| PolicyManager::new(mtm)),
_focus_manager: mtm.map(|mtm| FocusManager::new(mtm)),
_policy_manager: mtm.map(PolicyManager::new),
_focus_manager: mtm.map(FocusManager::new),
}
}

Expand Down

0 comments on commit 2787c56

Please sign in to comment.