Document Pu128.

And move the `repr` line after the `derive` line, where it's harder to
overlook. (I overlooked it initially, and didn't understand how this
type worked.)
This commit is contained in:
Nicholas Nethercote 2024-05-06 15:36:46 +10:00
parent 55b6ff8e41
commit d7814e72eb

View File

@ -3,8 +3,10 @@
use std::cmp::Ordering;
use std::fmt;
#[repr(packed(8))]
/// A packed 128-bit integer. Useful for reducing the size of structures in
/// some cases.
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
#[repr(packed(8))]
pub struct Pu128(pub u128);
impl Pu128 {