-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
rust/src/libstd/io/buffered.rs
Line 662 in eeaf497
if buf.len() >= self.buf.capacity() { |
Suppose you had a BufWriter
with capacity 4. If you write b"1234"
to it, that will be flushed directly to the underlying stream, but if you write b"12"
and then b"34"
, those will be buffered. The unit tests confirm this behavior, but it seems surprising to me.
jfrimmel and jack-fortanix
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.