Skip to content

Commit fd42813

Browse files
committed
work around clippy bug: rust-lang/rust-clippy#6446
1 parent 3ca821a commit fd42813

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

crates/lsp/src/lsp.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -532,12 +532,15 @@ impl LanguageServer {
532532

533533
while let Some(msg) = input_handler.notifications_channel.next().await {
534534
{
535-
let notification_handlers = notification_handlers.lock();
536-
if let Some(handler) = notification_handlers.get(msg.method.as_str()).cloned() {
537-
drop(notification_handlers);
535+
let handler = {
536+
notification_handlers
537+
.lock()
538+
.get(msg.method.as_str())
539+
.cloned()
540+
};
541+
if let Some(handler) = handler {
538542
handler(msg.id, msg.params.unwrap_or(Value::Null), cx.clone()).await;
539543
} else {
540-
drop(notification_handlers);
541544
on_unhandled_notification(msg);
542545
}
543546
}

0 commit comments

Comments
 (0)