diff options
| author | Folkert de Vries <folkert@folkertdev.nl> | 2025-07-05 08:36:27 +0200 |
|---|---|---|
| committer | Folkert de Vries <folkert@folkertdev.nl> | 2025-07-05 10:55:42 +0200 |
| commit | ed3711ea29398b09483e4e2a3930567e9ba81d93 (patch) | |
| tree | 58de9f15513d65c6fc1bf3cd61132ae046706e37 /compiler/rustc_serialize | |
| parent | 226b0fbe11812c71c8002b10a40063571cf52b3f (diff) | |
| download | rust-ed3711ea29398b09483e4e2a3930567e9ba81d93.tar.gz rust-ed3711ea29398b09483e4e2a3930567e9ba81d93.zip | |
use `div_ceil` instead of manual logic
Diffstat (limited to 'compiler/rustc_serialize')
| -rw-r--r-- | compiler/rustc_serialize/src/leb128.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_serialize/src/leb128.rs b/compiler/rustc_serialize/src/leb128.rs index 954c1f728f2..da328dcea03 100644 --- a/compiler/rustc_serialize/src/leb128.rs +++ b/compiler/rustc_serialize/src/leb128.rs @@ -7,7 +7,7 @@ use crate::serialize::Decoder; /// Returns the length of the longest LEB128 encoding for `T`, assuming `T` is an integer type pub const fn max_leb128_len<T>() -> usize { // The longest LEB128 encoding for an integer uses 7 bits per byte. - (size_of::<T>() * 8 + 6) / 7 + (size_of::<T>() * 8).div_ceil(7) } /// Returns the length of the longest LEB128 encoding of all supported integer types. |
