diff options
| author | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-11-27 11:15:06 +0000 |
|---|---|---|
| committer | Maybe Waffle <waffle.lapkin@gmail.com> | 2022-11-27 11:19:04 +0000 |
| commit | 1d42936b18d08ba414d9def35508d3baf2175c72 (patch) | |
| tree | 51455a78c9b21656485c0f724385d966b0be7b77 /compiler/rustc_serialize/src | |
| parent | 0e9eee68111ec742c3d60bb96078994c494a59fb (diff) | |
| download | rust-1d42936b18d08ba414d9def35508d3baf2175c72.tar.gz rust-1d42936b18d08ba414d9def35508d3baf2175c72.zip | |
Prefer doc comments over `//`-comments in compiler
Diffstat (limited to 'compiler/rustc_serialize/src')
| -rw-r--r-- | compiler/rustc_serialize/src/leb128.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_serialize/src/opaque.rs | 26 |
2 files changed, 14 insertions, 14 deletions
diff --git a/compiler/rustc_serialize/src/leb128.rs b/compiler/rustc_serialize/src/leb128.rs index 08b3c054200..a6cdd32f23b 100644 --- a/compiler/rustc_serialize/src/leb128.rs +++ b/compiler/rustc_serialize/src/leb128.rs @@ -7,7 +7,7 @@ macro_rules! max_leb128_len { }; } -// Returns the longest LEB128 encoding of all supported integer types. +/// Returns the longest LEB128 encoding of all supported integer types. pub const fn max_leb128_len() -> usize { max_leb128_len!(u128) } diff --git a/compiler/rustc_serialize/src/opaque.rs b/compiler/rustc_serialize/src/opaque.rs index f35cc08f4fb..7c54df809f1 100644 --- a/compiler/rustc_serialize/src/opaque.rs +++ b/compiler/rustc_serialize/src/opaque.rs @@ -155,19 +155,19 @@ impl Encoder for MemEncoder { pub type FileEncodeResult = Result<usize, io::Error>; -// `FileEncoder` encodes data to file via fixed-size buffer. -// -// When encoding large amounts of data to a file, using `FileEncoder` may be -// preferred over using `MemEncoder` to encode to a `Vec`, and then writing the -// `Vec` to file, as the latter uses as much memory as there is encoded data, -// while the former uses the fixed amount of memory allocated to the buffer. -// `FileEncoder` also has the advantage of not needing to reallocate as data -// is appended to it, but the disadvantage of requiring more error handling, -// which has some runtime overhead. +/// `FileEncoder` encodes data to file via fixed-size buffer. +/// +/// When encoding large amounts of data to a file, using `FileEncoder` may be +/// preferred over using `MemEncoder` to encode to a `Vec`, and then writing the +/// `Vec` to file, as the latter uses as much memory as there is encoded data, +/// while the former uses the fixed amount of memory allocated to the buffer. +/// `FileEncoder` also has the advantage of not needing to reallocate as data +/// is appended to it, but the disadvantage of requiring more error handling, +/// which has some runtime overhead. pub struct FileEncoder { - // The input buffer. For adequate performance, we need more control over - // buffering than `BufWriter` offers. If `BufWriter` ever offers a raw - // buffer access API, we can use it, and remove `buf` and `buffered`. + /// The input buffer. For adequate performance, we need more control over + /// buffering than `BufWriter` offers. If `BufWriter` ever offers a raw + /// buffer access API, we can use it, and remove `buf` and `buffered`. buf: Box<[MaybeUninit<u8>]>, buffered: usize, flushed: usize, @@ -711,7 +711,7 @@ impl<'a> Decodable<MemDecoder<'a>> for Vec<u8> { } } -// An integer that will always encode to 8 bytes. +/// An integer that will always encode to 8 bytes. pub struct IntEncodedWithFixedSize(pub u64); impl IntEncodedWithFixedSize { |
