Skip to content

Commit e5b3351

Browse files
committed
fix: use write_all() to write space after a tag
`write()` should not return Ok without writing anything, but the documentation is not clear on this and underlying implementation may be wrong as IMAP can be run over various streams, e.g. compressed, encrypted, proxied. It is safer to use `write_all()` everywhere, even when we write a single byte.
1 parent b37821f commit e5b3351

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/imap_stream.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ impl<R: Read + Write + Unpin> ImapStream<R> {
4747

4848
if let Some(tag) = msg.0 {
4949
self.inner.write_all(tag.as_bytes()).await?;
50-
self.inner.write(b" ").await?;
50+
self.inner.write_all(b" ").await?;
5151
}
5252
self.inner.write_all(&msg.1).await?;
5353
self.inner.write_all(b"\r\n").await?;

0 commit comments

Comments
 (0)