Skip to content

Commit

Permalink
prompt: tweak conditional compilation so as not to trigger `unused_…
Browse files Browse the repository at this point in the history
…mut` lint on Windows and Linux

thanks to @rzmk's PR - $1879
  • Loading branch information
jqnatividad committed Jun 15, 2024
1 parent 8d20710 commit b15c6fd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/cmd/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,15 +159,19 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
let title = args
.flag_msg
.unwrap_or_else(|| DEFAULT_OUTPUT_TITLE.to_owned());
let mut fd = FileDialog::new()

#[cfg(not(target_os = "macos"))]
let fd = FileDialog::new()
.set_directory(args.flag_workdir)
.set_title(title)
.set_file_name(args.flag_save_fname);

#[cfg(target_os = "macos")]
{
fd = fd.set_can_create_directories(true);
}
let fd = FileDialog::new()
.set_directory(args.flag_workdir)
.set_title(title)
.set_file_name(args.flag_save_fname)
.set_can_create_directories(true);

// no delay here, we want the save dialog to appear immediately
// the delay is only for input dialogs, so they pop over in reverse order
Expand Down

0 comments on commit b15c6fd

Please sign in to comment.