InliningAddresses
This commit is contained in:
parent
2ff8e11317
commit
effc7f4527
@ -40,6 +40,24 @@ impl Addresses {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub trait InliningAddresses: Inlining {
|
||||||
|
fn inext_address<E>(
|
||||||
|
self,
|
||||||
|
addresses: &mut Addresses,
|
||||||
|
err: impl FnOnce(&[u8]) -> E,
|
||||||
|
) -> Result<(Address, Self), E> {
|
||||||
|
let (point, deserializer) = self.iread_n_const::<HASH_SIZE>(err)?;
|
||||||
|
let address = Address {
|
||||||
|
point,
|
||||||
|
index: addresses.current,
|
||||||
|
};
|
||||||
|
addresses.current += 1;
|
||||||
|
Ok((address, deserializer))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl<D: Inlining> InliningAddresses for D {}
|
||||||
|
|
||||||
fn _parse_slice<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>>(
|
fn _parse_slice<'a, Ctx: Context<'a>, A: Mentionable<'a, Ctx>>(
|
||||||
factory: &A::Fctr,
|
factory: &A::Fctr,
|
||||||
slice: &[u8],
|
slice: &[u8],
|
||||||
|
Loading…
Reference in New Issue
Block a user