Skip to content

Commit

Permalink
Remove local variables in FileChooserDialog::with_buttons
Browse files Browse the repository at this point in the history
This commit removes the Stash variables from
`FileChooserDialog::with_buttons`, as requested in the PR gtk-rs#602
  • Loading branch information
demurgos committed Dec 7, 2017
1 parent 9238567 commit 607e824
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions src/file_chooser_dialog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,43 +42,37 @@ 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].0.to_glib_none() as Stash<*const c_char, str>).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].0.to_glib_none() as Stash<*const c_char, str>).0,
buttons[1].1.to_glib(),
third_button_text.0,
(buttons[2].0.to_glib_none() as Stash<*const c_char, str>).0,
buttons[2].1.to_glib(),
ptr::null::<c_char>(),
)
Expand Down

0 comments on commit 607e824

Please sign in to comment.