simplify bool::a_deserialize
This commit is contained in:
parent
03a809e92b
commit
f27e9625e8
@ -45,12 +45,7 @@ impl Atomic for bool {
|
||||
type AParseError = BooleanParseError;
|
||||
|
||||
fn a_deserialize(inlining: impl Inlining) -> AParseResult<Self> {
|
||||
let (byte, _) = inlining.iread_n_const::<1>(|slice| BooleanParseError::from(slice))?;
|
||||
match byte[0] {
|
||||
0 => Ok(false),
|
||||
1 => Ok(true),
|
||||
value => Err(BooleanParseError::OutOfBounds(value)),
|
||||
}
|
||||
Self::a_ideserialize(inlining).seal()
|
||||
}
|
||||
|
||||
fn a_extend(self, tail: &[u8]) -> AParseResult<Self> {
|
||||
|
Loading…
Reference in New Issue
Block a user