diff --git a/src/components/tab_label/mod.rs b/src/components/tab_label/mod.rs index 1b45623..e47b028 100644 --- a/src/components/tab_label/mod.rs +++ b/src/components/tab_label/mod.rs @@ -17,8 +17,9 @@ impl TabLabel { pub fn new>(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 }