Skip to content

Commit e0bf75b

Browse files
committed
EBML: Derive Default for VInt
1 parent b2af7a8 commit e0bf75b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lofty/src/ebml/vint.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use byteorder::{ReadBytesExt, WriteBytesExt};
1212
///
1313
/// To ensure safe construction of `VInt`s, users must create them through [`VInt::parse`] or [`VInt::from_u64`].
1414
#[repr(transparent)]
15-
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
15+
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug, Default)]
1616
pub struct VInt(pub(crate) u64);
1717

1818
impl VInt {
@@ -256,7 +256,8 @@ impl VInt {
256256
Ok(ret)
257257
}
258258

259-
pub(crate) fn saturating_sub(&self, other: u64) -> Self {
259+
#[inline]
260+
pub(crate) fn saturating_sub(self, other: u64) -> Self {
260261
Self(self.0.saturating_sub(other))
261262
}
262263
}

0 commit comments

Comments
 (0)