Skip to content

Commit 4310e55

Browse files
authored
Merge pull request #40 from nyurik/doc-fixes
docs: use links and backticks
2 parents af91eaa + 0699ee4 commit 4310e55

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/reader.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use tokio::io::{AsyncRead, AsyncReadExt};
1010
#[cfg(feature = "futures_async")]
1111
use futures_util::{io::AsyncRead, io::AsyncReadExt};
1212

13-
/// A trait for reading VarInts from any other `Reader`.
13+
/// A trait for reading [`VarInts`] from any other `Reader`.
1414
///
1515
/// It's recommended to use a buffered reader, as many small reads will happen.
1616
pub trait VarIntReader {
@@ -19,7 +19,7 @@ pub trait VarIntReader {
1919
/// In general, this always reads a whole varint. If the encoded varint's value is bigger
2020
/// than the valid value range of `VI`, then the value is truncated.
2121
///
22-
/// On EOF, an io::Error with io::ErrorKind::UnexpectedEof is returned.
22+
/// On EOF, an [`io::Error`] with [`io::ErrorKind::UnexpectedEof`] is returned.
2323
fn read_varint<VI: VarInt>(&mut self) -> Result<VI>;
2424
}
2525

@@ -30,7 +30,7 @@ pub trait VarIntAsyncReader {
3030
async fn read_varint_async<VI: VarInt>(&mut self) -> Result<VI>;
3131
}
3232

33-
/// VarIntProcessor encapsulates the logic for decoding a VarInt byte-by-byte.
33+
/// `VarIntProcessor` encapsulates the logic for decoding a [`VarInt`] byte-by-byte.
3434
#[derive(Default)]
3535
pub struct VarIntProcessor {
3636
buf: [u8; 10],
@@ -114,11 +114,11 @@ impl<R: Read> VarIntReader for R {
114114
}
115115
}
116116

117-
/// A trait for reading FixedInts from any other `Reader`.
117+
/// A trait for reading [`FixedInts`] from any other `Reader`.
118118
pub trait FixedIntReader {
119119
/// Read a fixed integer from a reader. How many bytes are read depends on `FI`.
120120
///
121-
/// On EOF, an io::Error with io::ErrorKind::UnexpectedEof is returned.
121+
/// On EOF, an [`io::Error`] with [`io::ErrorKind::UnexpectedEof`] is returned.
122122
fn read_fixedint<FI: FixedInt>(&mut self) -> Result<FI>;
123123
}
124124

src/varint.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub const MSB: u8 = 0b1000_0000;
66
/// bit using `&` (binary-and).
77
const DROP_MSB: u8 = 0b0111_1111;
88

9-
/// How many bytes an integer uses when being encoded as a VarInt.
9+
/// How many bytes an integer uses when being encoded as a `VarInt`.
1010
#[inline]
1111
fn required_encoded_space_unsigned(mut v: u64) -> usize {
1212
if v == 0 {
@@ -21,14 +21,14 @@ fn required_encoded_space_unsigned(mut v: u64) -> usize {
2121
logcounter
2222
}
2323

24-
/// How many bytes an integer uses when being encoded as a VarInt.
24+
/// How many bytes an integer uses when being encoded as a [`VarInt`].
2525
#[inline]
2626
fn required_encoded_space_signed(v: i64) -> usize {
2727
required_encoded_space_unsigned(zigzag_encode(v))
2828
}
2929

3030
/// Varint (variable length integer) encoding, as described in
31-
/// https://developers.google.com/protocol-buffers/docs/encoding.
31+
/// <https://developers.google.com/protocol-buffers/docs/encoding>.
3232
///
3333
/// Uses zigzag encoding (also described there) for signed integer representation.
3434
pub trait VarInt: Sized + Copy {

src/writer.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use tokio::io::{AsyncWrite, AsyncWriteExt};
99
#[cfg(feature = "futures_async")]
1010
use futures_util::{io::AsyncWrite, io::AsyncWriteExt};
1111

12-
/// A trait for writing integers in VarInt encoding to any `Write` type. This packs encoding and
12+
/// A trait for writing integers in [`VarInt`] encoding to any [`Write`] type. This packs encoding and
1313
/// writing into one step.
1414
pub trait VarIntWriter {
1515
fn write_varint<VI: VarInt>(&mut self, n: VI) -> Result<usize>;

0 commit comments

Comments
 (0)