Skip to content

Commit

Permalink
work around clippy bug: rust-lang/rust-clippy#6446
Browse files Browse the repository at this point in the history
  • Loading branch information
osiewicz committed Jan 17, 2025
1 parent 3ca821a commit fd42813
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/lsp/src/lsp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -532,12 +532,15 @@ impl LanguageServer {

while let Some(msg) = input_handler.notifications_channel.next().await {
{
let notification_handlers = notification_handlers.lock();
if let Some(handler) = notification_handlers.get(msg.method.as_str()).cloned() {
drop(notification_handlers);
let handler = {
notification_handlers
.lock()
.get(msg.method.as_str())
.cloned()
};
if let Some(handler) = handler {
handler(msg.id, msg.params.unwrap_or(Value::Null), cx.clone()).await;
} else {
drop(notification_handlers);
on_unhandled_notification(msg);
}
}
Expand Down

0 comments on commit fd42813

Please sign in to comment.