mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
style: Simplify initialization of thread_state.
This commit is contained in:
parent
eaf69c29ec
commit
6264268c82
1 changed files with 3 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue