Skip to content

Commit d7cb2f8

Browse files
committed
style(lsp): 修复 clippy while_let_loop 警告
1 parent 061bef9 commit d7cb2f8

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

src-tauri/src/lsp.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -373,12 +373,8 @@ pub fn lsp_start(
373373
let app_reader = app.clone();
374374
let lang_emit = language.clone();
375375
std::thread::spawn(move || {
376-
loop {
377-
// 阻塞等待第一条;channel 关闭即语言服务器退出
378-
let first = match msg_rx.recv() {
379-
Ok(m) => m,
380-
Err(_) => break,
381-
};
376+
// 阻塞等待第一条;channel 关闭(语言服务器退出)时 recv 返回 Err,循环结束
377+
while let Ok(first) = msg_rx.recv() {
382378
let mut batch = vec![first];
383379
// 排空当前已到达的消息,凑成一批(上限防止单批过大)
384380
while let Ok(m) = msg_rx.try_recv() {

0 commit comments

Comments
 (0)