refactor: don't unwrap tab label' childs and use match when prepending it
If statements are for booleans, matches are intended for Options like these. See: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrapmerge-requests/23/head
parent
c8fd305d90
commit
8e31be7e47
|
@ -17,8 +17,9 @@ impl TabLabel {
|
|||
pub fn new<U: IsA<gtk::Widget>>(tab_label: Option<&U>) -> Self {
|
||||
let this: Self = glib::Object::new(&[]).expect("Failed to create 'TabLabel' component.");
|
||||
|
||||
if tab_label.is_some() {
|
||||
this.prepend(tab_label.unwrap());
|
||||
match tab_label {
|
||||
Some(tab_label) => this.prepend(tab_label),
|
||||
None => {}
|
||||
}
|
||||
this
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue