jeremyletang / rgtk

GTK+ bindings and wrappers for Rust (DEPRECATED SEE https://github.com/rust-gnome )
GNU Lesser General Public License v3.0
120 stars 22 forks source link

Use to_bool and to_gboolean instead of ifs and matches #195

Closed gkoz closed 9 years ago

gkoz commented 9 years ago

This should make the code a bit more readable and fixes at least one copypasting mistake.

GuillaumeGomez commented 9 years ago

That's right that we thought about doing it from a long time now. So thank you for this PR and your contribution !

gkoz commented 9 years ago

There's gtk::traits::recent_chooser remaining with this kind of match I'm not sure about:

unsafe { ffi::gtk_recent_chooser_set_show_private(GTK_RECENT_CHOOSER(self.get_widget()), match show_private {
true => ffi::GTRUE,
false => ffi::GTRUE
}) }
GuillaumeGomez commented 9 years ago

Hum... I think this is an error. Replace it with to_gboolean please. I'll merge your PR after your change.

gkoz commented 9 years ago

Done.

GuillaumeGomez commented 9 years ago

Thanks a lot ! Waiting for travis and it's merged !