diff --git a/components/style/thread_state.rs b/components/style/thread_state.rs index b0fbd5f4294..9f6dc5df8e8 100644 --- a/components/style/thread_state.rs +++ b/components/style/thread_state.rs @@ -60,10 +60,9 @@ mod imp { pub fn initialize(x: ThreadState) { STATE.with(|ref k| { - match *k.borrow() { - Some(s) => panic!("Thread state already initialized as {:?}", s), - None => () - }; + if let Some(ref s) = *k.borrow() { + panic!("Thread state already initialized as {:?}", s); + } *k.borrow_mut() = Some(x); }); get(); // check the assertion below