mirror of
https://github.com/Serial-ATA/lofty-rs
synced 2024-12-13 14:12:31 +00:00
EBML: Derive Default for VInt
This commit is contained in:
parent
0e99b36973
commit
1031dabc00
1 changed files with 3 additions and 2 deletions
|
@ -12,7 +12,7 @@ use byteorder::{ReadBytesExt, WriteBytesExt};
|
|||
///
|
||||
/// To ensure safe construction of `VInt`s, users must create them through [`VInt::parse`] or [`VInt::from_u64`].
|
||||
#[repr(transparent)]
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)]
|
||||
pub struct VInt(pub(crate) u64);
|
||||
|
||||
impl VInt {
|
||||
|
@ -256,7 +256,8 @@ impl VInt {
|
|||
Ok(ret)
|
||||
}
|
||||
|
||||
pub(crate) fn saturating_sub(&self, other: u64) -> Self {
|
||||
#[inline]
|
||||
pub(crate) fn saturating_sub(self, other: u64) -> Self {
|
||||
Self(self.0.saturating_sub(other))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue