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

Commit

Permalink
Remove extraneous local variable in FileChooserDialog::with_buttons
Browse files Browse the repository at this point in the history
This commit removes the `first_button_text` variable from
`FileChooserDialog::with_buttons`, as requested in the PR #602
  • Loading branch information
demurgos committed Dec 7, 2017
1 parent 9238567 commit b046957
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/file_chooser_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,39 +42,36 @@ 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::<c_char>(),
)
},
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(),
ptr::null::<c_char>(),
)
},
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(),
Expand Down

0 comments on commit b046957

Please sign in to comment.