diff --git a/crates/flat-rs/src/encode/encoder.rs b/crates/flat-rs/src/encode/encoder.rs index 127d1bae..409ee653 100644 --- a/crates/flat-rs/src/encode/encoder.rs +++ b/crates/flat-rs/src/encode/encoder.rs @@ -236,13 +236,13 @@ impl Encoder { self.used_bits += num_bits; let unused_bits = 8 - self.used_bits; match unused_bits { - x if x > 0 => { - self.current_byte |= val << x; - } - x if x == 0 => { + 0 => { self.current_byte |= val; self.next_word(); } + x if x > 0 => { + self.current_byte |= val << x; + } x => { let used = -x; self.current_byte |= val >> used; diff --git a/crates/uplc/src/flat.rs b/crates/uplc/src/flat.rs index 0505cf6e..3b36b516 100644 --- a/crates/uplc/src/flat.rs +++ b/crates/uplc/src/flat.rs @@ -208,14 +208,14 @@ where 7 => Ok(Term::Builtin(DefaultFunction::decode(d)?)), 8 => { let tag = usize::decode(d)?; - let fields = d.decode_list_with(|d| Term::::decode(d))?; + let fields = d.decode_list_with(Term::::decode)?; Ok(Term::Constr { tag, fields }) } 9 => { let constr = (Term::::decode(d)?).into(); - let branches = d.decode_list_with(|d| Term::::decode(d))?; + let branches = d.decode_list_with(Term::::decode)?; Ok(Term::Case { constr, branches }) }