Skip to content

Commit fc0bfe1

Browse files
committed
doc: simplify varint documentation
1 parent 23ef525 commit fc0bfe1

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

datadog-profiling-protobuf/src/varint.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,11 @@ impl Value for Varint {
2020
((((self.0 | 1).leading_zeros() ^ 63) * 9 + 73) / 64) as u64
2121
}
2222

23-
/// Encodes a varint according to protobuf semantics.
23+
/// Encodes a [`varint`] according to protobuf semantics.
2424
///
25-
/// Note that it will write between 1 and 10 bytes, inclusive. You should
26-
/// probably write to a buffered Write object--if you write directly to
27-
/// something like a TCP stream, it's going to send one byte at a time,
28-
/// which is excessively inefficient. In libdatadog, we typically write to
29-
/// some sort of compressor which has its own input buffer.
25+
/// Serialization happens one byte at a time; use a buffered writer.
3026
///
31-
/// See https://protobuf.dev/programming-guides/encoding/#varints
27+
/// [`varint`]: https://protobuf.dev/programming-guides/encoding/#varints
3228
#[inline]
3329
fn encode<W: Write>(&self, writer: &mut W) -> io::Result<()> {
3430
let mut value = self.0;

0 commit comments

Comments
 (0)