Repository: servo/servo
File: components/servo/servo.rs (Rust)

Code before:
                Err(()) => self
                    .delegate
                    .borrow()
                    .notify_error(ServoError::DevtoolsFailedToStart),
            },
            EmbedderMsg::RequestDevtoolsConnection(response_sender) => {
                self.delegate
                    .borrow()
                    .request_devtools_connection(AllowOrDenyRequest::new(
                        response_sender,
                        AllowOrDeny::Deny,
                        self.servo_errors.sender(),
                    ));
            },
            EmbedderMsg::PlayGamepadHapticEffect(
                webview_id,
                gamepad_index,
                gamepad_haptic_effect_type,
                callback,
            ) => {
                if let Some(webview) = self.get_webview_handle(webview_id) {
                    webview.delegate().play_gamepad_haptic_effect(
                        webview,
                        gamepad_index,
                        gamepad_haptic_effect_type,
                        Box::new(move |msg| {
                            callback
                                .send(msg)
                                .expect("Could not send message via callback")
                        }),
                    );
                }
            },
            EmbedderMsg::StopGamepadHapticEffect(webview_id, gamepad_index, callback) => {
                if let Some(webview) = self.get_webview_handle(webview_id) {
                    webview.delegate().stop_gamepad_haptic_effect(
                        webview,
                        gamepad_index,
                        Box::new(move |msg| {
                            callback
                                .send(msg)
                                .expect("Could not send message via callback")
                        }),
                    );
                }
            },
            EmbedderMsg::ShowNotification(webview_id, notification) => {
                match webview_id.and_then(|webview_id| self.get_webview_handle(webview_id)) {
                    Some(webview) => webview.delegate().show_notification(webview, notification),
                    None => self.delegate.borrow().show_notification(notification),
                }

Review comment (suggestion):
```suggestion
                        Box::new(move |success| {
```

Code after:
                    .borrow()
                    .notify_error(ServoError::DevtoolsFailedToStart),
            },
            EmbedderMsg::RequestDevtoolsConnection(response_sender) => {
                self.delegate
                    .borrow()
                    .request_devtools_connection(AllowOrDenyRequest::new(
                        response_sender,
                        AllowOrDeny::Deny,
                        self.servo_errors.sender(),
                    ));
            },
            #[cfg(feature = "gamepad")]
            EmbedderMsg::PlayGamepadHapticEffect(
                webview_id,
                gamepad_index,
                gamepad_haptic_effect_type,
                callback,
            ) => {
                if let Some(webview) = self.get_webview_handle(webview_id) {
                    webview.delegate().play_gamepad_haptic_effect(
                        webview,
                        gamepad_index,
                        gamepad_haptic_effect_type,
                        Box::new(move |success| {
                            callback
                                .send(success)
                                .expect("Could not send message via callback")
                        }),
                    );
                }
            },
            #[cfg(feature = "gamepad")]
            EmbedderMsg::StopGamepadHapticEffect(webview_id, gamepad_index, callback) => {
                if let Some(webview) = self.get_webview_handle(webview_id) {
                    webview.delegate().stop_gamepad_haptic_effect(
                        webview,
                        gamepad_index,
                        Box::new(move |success| {
                            callback
                                .send(success)
                                .expect("Could not send message via callback")
                        }),
                    );
                }
            },
            EmbedderMsg::ShowNotification(webview_id, notification) => {
                match webview_id.and_then(|webview_id| self.get_webview_handle(webview_id)) {
                    Some(webview) => webview.delegate().show_notification(webview, notification),
                    None => self.delegate.borrow().show_notification(notification),
                }