Skip to content
This repository was archived by the owner on Jun 8, 2021. It is now read-only.

Commit 607e824

Browse files
committed
Remove local variables in FileChooserDialog::with_buttons
This commit removes the Stash variables from `FileChooserDialog::with_buttons`, as requested in the PR #602
1 parent 9238567 commit 607e824

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/file_chooser_dialog.rs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -42,43 +42,37 @@ impl FileChooserDialog {
4242
)
4343
},
4444
1 => {
45-
let first_button_text: Stash<*const c_char, str> = buttons[0].0.to_glib_none();
4645
ffi::gtk_file_chooser_dialog_new(
4746
title.to_glib_none().0,
4847
parent.to_glib_none().0,
4948
action.to_glib(),
50-
first_button_text.0,
49+
buttons[0].0.to_glib_none().0,
5150
buttons[0].1.to_glib(),
5251
ptr::null::<c_char>(),
5352
)
5453
},
5554
2 => {
56-
let first_button_text: Stash<*const c_char, str> = buttons[0].0.to_glib_none();
57-
let second_button_text: Stash<*const c_char, str> = buttons[1].0.to_glib_none();
5855
ffi::gtk_file_chooser_dialog_new(
5956
title.to_glib_none().0,
6057
parent.to_glib_none().0,
6158
action.to_glib(),
62-
first_button_text.0,
59+
buttons[0].0.to_glib_none().0,
6360
buttons[0].1.to_glib(),
64-
second_button_text.0,
61+
(buttons[1].0.to_glib_none() as Stash<*const c_char, str>).0,
6562
buttons[1].1.to_glib(),
6663
ptr::null::<c_char>(),
6764
)
6865
},
6966
3 => {
70-
let first_button_text: Stash<*const c_char, str> = buttons[0].0.to_glib_none();
71-
let second_button_text: Stash<*const c_char, str> = buttons[1].0.to_glib_none();
72-
let third_button_text: Stash<*const c_char, str> = buttons[2].0.to_glib_none();
7367
ffi::gtk_file_chooser_dialog_new(
7468
title.to_glib_none().0,
7569
parent.to_glib_none().0,
7670
action.to_glib(),
77-
first_button_text.0,
71+
buttons[0].0.to_glib_none().0,
7872
buttons[0].1.to_glib(),
79-
second_button_text.0,
73+
(buttons[1].0.to_glib_none() as Stash<*const c_char, str>).0,
8074
buttons[1].1.to_glib(),
81-
third_button_text.0,
75+
(buttons[2].0.to_glib_none() as Stash<*const c_char, str>).0,
8276
buttons[2].1.to_glib(),
8377
ptr::null::<c_char>(),
8478
)

0 commit comments

Comments
 (0)