Fix clippy warnings: remove redundant closures & guards.
This commit is contained in:
parent
d6f74b5932
commit
17832fc5af
|
@ -236,13 +236,13 @@ impl Encoder {
|
||||||
self.used_bits += num_bits;
|
self.used_bits += num_bits;
|
||||||
let unused_bits = 8 - self.used_bits;
|
let unused_bits = 8 - self.used_bits;
|
||||||
match unused_bits {
|
match unused_bits {
|
||||||
x if x > 0 => {
|
0 => {
|
||||||
self.current_byte |= val << x;
|
|
||||||
}
|
|
||||||
x if x == 0 => {
|
|
||||||
self.current_byte |= val;
|
self.current_byte |= val;
|
||||||
self.next_word();
|
self.next_word();
|
||||||
}
|
}
|
||||||
|
x if x > 0 => {
|
||||||
|
self.current_byte |= val << x;
|
||||||
|
}
|
||||||
x => {
|
x => {
|
||||||
let used = -x;
|
let used = -x;
|
||||||
self.current_byte |= val >> used;
|
self.current_byte |= val >> used;
|
||||||
|
|
|
@ -208,14 +208,14 @@ where
|
||||||
7 => Ok(Term::Builtin(DefaultFunction::decode(d)?)),
|
7 => Ok(Term::Builtin(DefaultFunction::decode(d)?)),
|
||||||
8 => {
|
8 => {
|
||||||
let tag = usize::decode(d)?;
|
let tag = usize::decode(d)?;
|
||||||
let fields = d.decode_list_with(|d| Term::<T>::decode(d))?;
|
let fields = d.decode_list_with(Term::<T>::decode)?;
|
||||||
|
|
||||||
Ok(Term::Constr { tag, fields })
|
Ok(Term::Constr { tag, fields })
|
||||||
}
|
}
|
||||||
9 => {
|
9 => {
|
||||||
let constr = (Term::<T>::decode(d)?).into();
|
let constr = (Term::<T>::decode(d)?).into();
|
||||||
|
|
||||||
let branches = d.decode_list_with(|d| Term::<T>::decode(d))?;
|
let branches = d.decode_list_with(Term::<T>::decode)?;
|
||||||
|
|
||||||
Ok(Term::Case { constr, branches })
|
Ok(Term::Case { constr, branches })
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue