mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
chore: convert unwrap to except and add a debug log
This commit is contained in:
parent
d9e9ca2981
commit
02d5c0ac56
1 changed files with 4 additions and 1 deletions
|
@ -3,6 +3,8 @@ use std::{
|
||||||
thread,
|
thread,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
use log::debug;
|
||||||
|
|
||||||
use crossbeam_channel::{bounded, Receiver, Sender};
|
use crossbeam_channel::{bounded, Receiver, Sender};
|
||||||
|
|
||||||
use crate::Message;
|
use crate::Message;
|
||||||
|
@ -23,7 +25,8 @@ pub(crate) fn stdio_transport() -> (Sender<Message>, Receiver<Message>, IoThread
|
||||||
while let Some(msg) = Message::read(&mut stdin)? {
|
while let Some(msg) = Message::read(&mut stdin)? {
|
||||||
let is_exit = matches!(&msg, Message::Notification(n) if n.is_exit());
|
let is_exit = matches!(&msg, Message::Notification(n) if n.is_exit());
|
||||||
|
|
||||||
reader_sender.send(msg).unwrap();
|
debug!("sending message {:#?}", msg);
|
||||||
|
reader_sender.send(msg).expect("receiver was dropped, failed to send a message");
|
||||||
|
|
||||||
if is_exit {
|
if is_exit {
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue