Skip to content

Commit 24443ed

Browse files
committed
Impl Deserializer::has_remaining_data
Signed-off-by: Jiahao XU <[email protected]>
1 parent c2b7e65 commit 24443ed

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/de.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,12 @@ where
147147
let len: usize = self.next_u32()?.try_into().map_err(|_| Error::TooLong)?;
148148
self.next_bytes(len)
149149
}
150+
151+
/// Is there any remaining data.
152+
pub fn has_remaining_data(&mut self) -> bool {
153+
self.update_slice();
154+
!self.slice.is_empty()
155+
}
150156
}
151157

152158
macro_rules! impl_for_deserialize_primitive {

0 commit comments

Comments
 (0)