We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b00d67e commit 120e8a6Copy full SHA for 120e8a6
lofty/src/ebml/vint.rs
@@ -127,6 +127,17 @@ macro_rules! impl_vint {
127
VInt::<$t>::write_to(self.0 as u64, min_length, max_length, &mut ret)?;
128
Ok(ret)
129
}
130
+
131
+ #[inline]
132
+ #[allow(dead_code)]
133
+ pub(crate) fn saturating_sub(self, other: $t) -> Self {
134
+ let v = self.0.saturating_sub(other);
135
+ if v < Self::MIN {
136
+ return Self(Self::MIN);
137
+ }
138
139
+ Self(v)
140
141
142
143
impl Add for VInt<$t> {
0 commit comments