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

Commit b046957

Browse files
committed
Remove extraneous local variable in FileChooserDialog::with_buttons
This commit removes the `first_button_text` variable from `FileChooserDialog::with_buttons`, as requested in the PR #602
1 parent 9238567 commit b046957

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/file_chooser_dialog.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,39 +42,36 @@ 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();
5755
let second_button_text: Stash<*const c_char, str> = buttons[1].0.to_glib_none();
5856
ffi::gtk_file_chooser_dialog_new(
5957
title.to_glib_none().0,
6058
parent.to_glib_none().0,
6159
action.to_glib(),
62-
first_button_text.0,
60+
buttons[0].0.to_glib_none().0,
6361
buttons[0].1.to_glib(),
6462
second_button_text.0,
6563
buttons[1].1.to_glib(),
6664
ptr::null::<c_char>(),
6765
)
6866
},
6967
3 => {
70-
let first_button_text: Stash<*const c_char, str> = buttons[0].0.to_glib_none();
7168
let second_button_text: Stash<*const c_char, str> = buttons[1].0.to_glib_none();
7269
let third_button_text: Stash<*const c_char, str> = buttons[2].0.to_glib_none();
7370
ffi::gtk_file_chooser_dialog_new(
7471
title.to_glib_none().0,
7572
parent.to_glib_none().0,
7673
action.to_glib(),
77-
first_button_text.0,
74+
buttons[0].0.to_glib_none().0,
7875
buttons[0].1.to_glib(),
7976
second_button_text.0,
8077
buttons[1].1.to_glib(),

0 commit comments

Comments
 (0)