Skip to content

Commit 288604e

Browse files
committed
comments
1 parent f5966cd commit 288604e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/utils/html.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ where
118118
};
119119

120120
let mut rewriter = HtmlRewriter::new(settings, move |chunk: &[u8]| {
121+
// this can fail only when the receiver is dropped.
121122
let _ = result_sender.send(Bytes::from(chunk.to_vec()));
122123
});
123124
while let Some(chunk) = data_receiver.recv()? {
@@ -134,7 +135,7 @@ where
134135
loop {
135136
let n = match reader.read(&mut read_buf).await {
136137
Ok(0) => {
137-
// this should get the background thread to exit
138+
// This signals the renderer thread to finalize & exit.
138139
data_sender.send(None).unwrap();
139140
break;
140141
}
@@ -146,7 +147,7 @@ where
146147
}
147148
};
148149
if let Err(err) = data_sender.send(Some(read_buf[..n].to_vec())) {
149-
// reveiver was dropped?
150+
// FIXME: reveiver was dropped? do we care about that?
150151
yield Err(RewritingError::ContentHandlerError(err.into()));
151152
break;
152153
}

0 commit comments

Comments
 (0)