Skip to content

Commit b0ad092

Browse files
committed
Address comments
1 parent f1ff55f commit b0ad092

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ version = "0.1.0"
44
edition = "2024"
55

66
[dependencies]
7-
dap = { git = "https://github.com/software-mansion-labs/dap-rs", branch = "debugger-poc" }
7+
dap = { git = "https://github.com/software-mansion-labs/dap-rs", rev = "4440a6f" }
88
tracing = "0.1"
99
anyhow = "1.0"

src/connection.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,11 @@ pub struct Connection {
1515
inbound_rx: mpsc::Receiver<Request>,
1616
outbound_tx: mpsc::Sender<Sendable>,
1717

18-
// NOTE: The order matters here.
18+
// NOTE: The order of members matters here.
1919
// I/O threads must be dropped after the channels.
2020
_io_threads: IoThreads,
2121
}
2222

23-
struct IoThreads {
24-
pub reader: Option<JoinHandle<()>>,
25-
pub writer: Option<JoinHandle<()>>,
26-
}
27-
2823
impl Connection {
2924
pub fn new() -> Result<Self> {
3025
let tcp_listener = TcpListener::bind("127.0.0.1:0").map_err(ServerError::IoError)?;
@@ -49,7 +44,7 @@ impl Connection {
4944
}
5045

5146
pub fn next_request(&self) -> Result<Request> {
52-
self.inbound_rx.recv().context("Connection close")
47+
self.inbound_rx.recv().context("Inbound connection closed")
5348
}
5449

5550
pub fn send_event(&self, event: Event) -> Result<()> {
@@ -71,6 +66,11 @@ impl Connection {
7166
}
7267
}
7368

69+
struct IoThreads {
70+
pub reader: Option<JoinHandle<()>>,
71+
pub writer: Option<JoinHandle<()>>,
72+
}
73+
7474
impl IoThreads {
7575
fn spawn(
7676
server_reader: ServerReader<TcpStream>,
@@ -119,7 +119,7 @@ fn spawn_writer_thread(
119119
Sendable::Event(event) => {
120120
server_writer.send_event(event).expect("Failed to send event")
121121
}
122-
Sendable::ReverseRequest(_) => unreachable!(),
122+
Sendable::ReverseRequest(_) => unreachable!("Reverse requests are not supported"),
123123
}
124124
}
125125
})

0 commit comments

Comments
 (0)