@@ -2017,11 +2017,11 @@ impl ScriptThread {
2017
2017
// occurs for the rest of the messages
2018
2018
match msg {
2019
2019
WebDriverScriptCommand :: ExecuteScript ( script, reply) => {
2020
- let window = { self . documents . borrow ( ) . find_window ( pipeline_id) } ;
2020
+ let window = self . documents . borrow ( ) . find_window ( pipeline_id) ;
2021
2021
return webdriver_handlers:: handle_execute_script ( window, script, reply) ;
2022
2022
} ,
2023
2023
WebDriverScriptCommand :: ExecuteAsyncScript ( script, reply) => {
2024
- let window = { self . documents . borrow ( ) . find_window ( pipeline_id) } ;
2024
+ let window = self . documents . borrow ( ) . find_window ( pipeline_id) ;
2025
2025
return webdriver_handlers:: handle_execute_async_script ( window, script, reply) ;
2026
2026
} ,
2027
2027
_ => ( ) ,
@@ -2289,7 +2289,7 @@ impl ScriptThread {
2289
2289
id : PipelineId ,
2290
2290
scroll_states : & [ ( UntrustedNodeAddress , Vector2D < f32 , LayoutPixel > ) ] ,
2291
2291
) {
2292
- let window = match { self . documents . borrow ( ) . find_window ( id) } {
2292
+ let window = match self . documents . borrow ( ) . find_window ( id) {
2293
2293
Some ( window) => window,
2294
2294
None => {
2295
2295
return warn ! (
@@ -2696,7 +2696,7 @@ impl ScriptThread {
2696
2696
Some ( r) => r,
2697
2697
None => return ,
2698
2698
} ;
2699
- let window = match { self . documents . borrow ( ) . find_window ( pipeline_id) } {
2699
+ let window = match self . documents . borrow ( ) . find_window ( pipeline_id) {
2700
2700
Some ( window) => window,
2701
2701
None => return warn ! ( "Registration failed for {}" , scope) ,
2702
2702
} ;
@@ -2775,7 +2775,7 @@ impl ScriptThread {
2775
2775
2776
2776
/// Handles a request for the window title.
2777
2777
fn handle_get_title_msg ( & self , pipeline_id : PipelineId ) {
2778
- let document = match { self . documents . borrow ( ) . find_document ( pipeline_id) } {
2778
+ let document = match self . documents . borrow ( ) . find_document ( pipeline_id) {
2779
2779
Some ( document) => document,
2780
2780
None => return warn ! ( "Message sent to closed pipeline {}." , pipeline_id) ,
2781
2781
} ;
@@ -2892,7 +2892,7 @@ impl ScriptThread {
2892
2892
2893
2893
/// Handles when layout thread finishes all animation in one tick
2894
2894
fn handle_tick_all_animations ( & self , id : PipelineId ) {
2895
- let document = match { self . documents . borrow ( ) . find_document ( id) } {
2895
+ let document = match self . documents . borrow ( ) . find_document ( id) {
2896
2896
Some ( document) => document,
2897
2897
None => return warn ! ( "Message sent to closed pipeline {}." , id) ,
2898
2898
} ;
@@ -2977,7 +2977,7 @@ impl ScriptThread {
2977
2977
old_value : Option < String > ,
2978
2978
new_value : Option < String > ,
2979
2979
) {
2980
- let window = match { self . documents . borrow ( ) . find_window ( pipeline_id) } {
2980
+ let window = match self . documents . borrow ( ) . find_window ( pipeline_id) {
2981
2981
None => return warn ! ( "Storage event sent to closed pipeline {}." , pipeline_id) ,
2982
2982
Some ( window) => window,
2983
2983
} ;
@@ -3380,7 +3380,7 @@ impl ScriptThread {
3380
3380
/// TODO: Actually perform DOM event dispatch.
3381
3381
fn handle_event ( & self , pipeline_id : PipelineId , event : CompositorEvent ) {
3382
3382
// Do not handle events if the pipeline exited.
3383
- let window = match { self . documents . borrow ( ) . find_window ( pipeline_id) } {
3383
+ let window = match self . documents . borrow ( ) . find_window ( pipeline_id) {
3384
3384
Some ( win) => win,
3385
3385
None => {
3386
3386
return warn ! (
@@ -3424,7 +3424,7 @@ impl ScriptThread {
3424
3424
} ,
3425
3425
3426
3426
MouseMoveEvent ( point, node_address, pressed_mouse_buttons) => {
3427
- let document = match { self . documents . borrow ( ) . find_document ( pipeline_id) } {
3427
+ let document = match self . documents . borrow ( ) . find_document ( pipeline_id) {
3428
3428
Some ( document) => document,
3429
3429
None => return warn ! ( "Message sent to closed pipeline {}." , pipeline_id) ,
3430
3430
} ;
@@ -3517,15 +3517,15 @@ impl ScriptThread {
3517
3517
} ,
3518
3518
3519
3519
KeyboardEvent ( key_event) => {
3520
- let document = match { self . documents . borrow ( ) . find_document ( pipeline_id) } {
3520
+ let document = match self . documents . borrow ( ) . find_document ( pipeline_id) {
3521
3521
Some ( document) => document,
3522
3522
None => return warn ! ( "Message sent to closed pipeline {}." , pipeline_id) ,
3523
3523
} ;
3524
3524
document. dispatch_key_event ( key_event) ;
3525
3525
} ,
3526
3526
3527
3527
CompositionEvent ( composition_event) => {
3528
- let document = match { self . documents . borrow ( ) . find_document ( pipeline_id) } {
3528
+ let document = match self . documents . borrow ( ) . find_document ( pipeline_id) {
3529
3529
Some ( document) => document,
3530
3530
None => return warn ! ( "Message sent to closed pipeline {}." , pipeline_id) ,
3531
3531
} ;
@@ -3546,7 +3546,7 @@ impl ScriptThread {
3546
3546
point_in_node : Option < Point2D < f32 > > ,
3547
3547
pressed_mouse_buttons : u16 ,
3548
3548
) {
3549
- let document = match { self . documents . borrow ( ) . find_document ( pipeline_id) } {
3549
+ let document = match self . documents . borrow ( ) . find_document ( pipeline_id) {
3550
3550
Some ( document) => document,
3551
3551
None => return warn ! ( "Message sent to closed pipeline {}." , pipeline_id) ,
3552
3552
} ;
@@ -3569,7 +3569,7 @@ impl ScriptThread {
3569
3569
point : Point2D < f32 > ,
3570
3570
node_address : Option < UntrustedNodeAddress > ,
3571
3571
) -> TouchEventResult {
3572
- let document = match { self . documents . borrow ( ) . find_document ( pipeline_id) } {
3572
+ let document = match self . documents . borrow ( ) . find_document ( pipeline_id) {
3573
3573
Some ( document) => document,
3574
3574
None => {
3575
3575
warn ! ( "Message sent to closed pipeline {}." , pipeline_id) ;
@@ -3592,7 +3592,7 @@ impl ScriptThread {
3592
3592
point : Point2D < f32 > ,
3593
3593
node_address : Option < UntrustedNodeAddress > ,
3594
3594
) {
3595
- let document = match { self . documents . borrow ( ) . find_document ( pipeline_id) } {
3595
+ let document = match self . documents . borrow ( ) . find_document ( pipeline_id) {
3596
3596
Some ( document) => document,
3597
3597
None => return warn ! ( "Message sent to closed pipeline {}." , pipeline_id) ,
3598
3598
} ;
@@ -3664,7 +3664,7 @@ impl ScriptThread {
3664
3664
new_size : WindowSizeData ,
3665
3665
size_type : WindowSizeType ,
3666
3666
) {
3667
- let document = match { self . documents . borrow ( ) . find_document ( pipeline_id) } {
3667
+ let document = match self . documents . borrow ( ) . find_document ( pipeline_id) {
3668
3668
Some ( document) => document,
3669
3669
None => return warn ! ( "Message sent to closed pipeline {}." , pipeline_id) ,
3670
3670
} ;
0 commit comments