feat(uplc): add Case and Const terms
- parsering - interning - flat encoding and decoding - pretty printing - debruijn conversion Co-authored-by: Lucas Rosa <x@rvcas.dev>
This commit is contained in:
@@ -171,7 +171,7 @@ impl<'b> Decoder<'b> {
|
||||
/// Otherwise we decode an item in the list with the decoder function passed in.
|
||||
/// Then decode the next bit in the buffer and repeat above.
|
||||
/// Returns a list of items decoded with the decoder function.
|
||||
pub fn decode_list_with<T: Decode<'b>, F>(&mut self, decoder_func: F) -> Result<Vec<T>, Error>
|
||||
pub fn decode_list_with<T, F>(&mut self, decoder_func: F) -> Result<Vec<T>, Error>
|
||||
where
|
||||
F: Copy + FnOnce(&mut Decoder) -> Result<T, Error>,
|
||||
{
|
||||
|
||||
@@ -196,10 +196,7 @@ impl Encoder {
|
||||
&mut self,
|
||||
list: &[T],
|
||||
encoder_func: for<'r> fn(&T, &'r mut Encoder) -> Result<(), Error>,
|
||||
) -> Result<&mut Self, Error>
|
||||
where
|
||||
T: Encode,
|
||||
{
|
||||
) -> Result<&mut Self, Error> {
|
||||
for item in list {
|
||||
self.one();
|
||||
encoder_func(item, self)?;
|
||||
|
||||
Reference in New Issue
Block a user