Skip to content

Commit 5bbf7a8

Browse files
committed
fix: don't dump messages just because something was removed from the pending replies box
1 parent 4155015 commit 5bbf7a8

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "async-io-converse"
3-
version = "1.0.0"
3+
version = "1.0.1"
44
edition = "2021"
55
license = "MIT OR Apache-2.0"
66
description = "Can conduct a conversation over any AsyncRead or AsyncWrite type with serde compatible types"

src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ impl<R: AsyncRead + Unpin, W: AsyncWrite + Unpin, T: Serialize + DeserializeOwne
199199
while let Ok(reply_data) = reply_data_receiver.try_recv() {
200200
pending_reply.push(reply_data);
201201
}
202-
let start_len = pending_reply.len();
203202
let mut user_message = Some(i.user_message);
204203
pending_reply.retain_mut(|pending_reply| {
205204
if let Some(reply_sender) = pending_reply.reply_sender.as_ref() {
@@ -218,7 +217,7 @@ impl<R: AsyncRead + Unpin, W: AsyncWrite + Unpin, T: Serialize + DeserializeOwne
218217
}
219218
!matches
220219
});
221-
if start_len == pending_reply.len() {
220+
if !i.is_reply {
222221
return Poll::Ready(Some(Ok(ReceivedMessage {
223222
message: Some(user_message.take().expect("infallible")),
224223
conversation_id: i.conversation_id,

0 commit comments

Comments
 (0)