mirror of
https://codeberg.org/icewind/bitbuffer.git
synced 2026-06-03 16:44:06 +02:00
derive unchecked methods for traits
This commit is contained in:
parent
55eb866eb6
commit
a6e9b59ece
2 changed files with 39 additions and 13 deletions
|
|
@ -92,6 +92,9 @@ pub trait BitRead<E: Endianness>: Sized {
|
|||
/// Read the type from stream
|
||||
fn read(stream: &mut BitStream<E>) -> Result<Self>;
|
||||
|
||||
/// Note: only the bounds are unchecked
|
||||
///
|
||||
/// any other validations (e.g. checking for valid utf8) still needs to be done
|
||||
#[doc(hidden)]
|
||||
unsafe fn read_unchecked(stream: &mut BitStream<E>) -> Result<Self> {
|
||||
Self::read(stream)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue