about summary refs log tree commit diff
path: root/tests/rustdoc-ui/coverage/enum-tuple-documented.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-12-31 13:21:27 +0000
committerbors <bors@rust-lang.org>2024-12-31 13:21:27 +0000
commit7a0cde96f83c6d38237bb8062df6300ecf4c2687 (patch)
tree31492a1ca4f6c02f24e10def3500e03a8638524a /tests/rustdoc-ui/coverage/enum-tuple-documented.rs
parentaea4e4370330388bf2906b79769d43e581d487b4 (diff)
parentfdb43ef0c456514d634741e46a1f4eba454f1a84 (diff)
downloadrust-7a0cde96f83c6d38237bb8062df6300ecf4c2687.tar.gz
rust-7a0cde96f83c6d38237bb8062df6300ecf4c2687.zip
Auto merge of #134620 - ChrisDenton:line-writer, r=tgross35
Avoid short writes in LineWriter

If the bytes written to `LineWriter` contains at least one new line but doesn't end in a new line (e.g. `"abc\ndef"`) then we:

- write up to the last new line direct to the underlying `Writer`.
- copy as many of the remaining bytes as will fit into our internal buffer.

That last step is inefficient if the remaining bytes are larger than our buffer. It will needlessly split the bytes in two, requiring at least two writes to the underlying `Writer` (one to flush the buffer, one more to write the rest). This PR skips the extra buffering if the remaining bytes are larger than the buffer.
Diffstat (limited to 'tests/rustdoc-ui/coverage/enum-tuple-documented.rs')
0 files changed, 0 insertions, 0 deletions