From b0469571038ca5fa4dfae642d41d0ee302c6c34b Mon Sep 17 00:00:00 2001 From: Charles Samborski Date: Thu, 7 Dec 2017 12:17:07 +0100 Subject: [PATCH] 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 --- src/file_chooser_dialog.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/file_chooser_dialog.rs b/src/file_chooser_dialog.rs index 595a20cdc4..586c9411d5 100644 --- a/src/file_chooser_dialog.rs +++ b/src/file_chooser_dialog.rs @@ -42,24 +42,22 @@ impl FileChooserDialog { ) }, 1 => { - let first_button_text: Stash<*const c_char, str> = buttons[0].0.to_glib_none(); ffi::gtk_file_chooser_dialog_new( title.to_glib_none().0, parent.to_glib_none().0, action.to_glib(), - first_button_text.0, + buttons[0].0.to_glib_none().0, buttons[0].1.to_glib(), ptr::null::(), ) }, 2 => { - let first_button_text: Stash<*const c_char, str> = buttons[0].0.to_glib_none(); let second_button_text: Stash<*const c_char, str> = buttons[1].0.to_glib_none(); ffi::gtk_file_chooser_dialog_new( title.to_glib_none().0, parent.to_glib_none().0, action.to_glib(), - first_button_text.0, + buttons[0].0.to_glib_none().0, buttons[0].1.to_glib(), second_button_text.0, buttons[1].1.to_glib(), @@ -67,14 +65,13 @@ impl FileChooserDialog { ) }, 3 => { - let first_button_text: Stash<*const c_char, str> = buttons[0].0.to_glib_none(); let second_button_text: Stash<*const c_char, str> = buttons[1].0.to_glib_none(); let third_button_text: Stash<*const c_char, str> = buttons[2].0.to_glib_none(); ffi::gtk_file_chooser_dialog_new( title.to_glib_none().0, parent.to_glib_none().0, action.to_glib(), - first_button_text.0, + buttons[0].0.to_glib_none().0, buttons[0].1.to_glib(), second_button_text.0, buttons[1].1.to_glib(),