clippy
This commit is contained in:
parent
5239d5eb0b
commit
40b5891323
5 changed files with 9 additions and 5 deletions
|
@ -17,6 +17,10 @@ impl<'a> FormatString {
|
|||
pub fn len(&self) -> usize {
|
||||
self.parts.len() - 1
|
||||
}
|
||||
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.parts.len() == 1
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> From<&str> for FormatString {
|
||||
|
|
|
@ -76,7 +76,7 @@ impl<T: Field> From<FlatStatement<T>> for Statement<T> {
|
|||
l,
|
||||
expressions
|
||||
.into_iter()
|
||||
.map(|(t, e)| (t, e.into_iter().map(|e| LinComb::from(e)).collect()))
|
||||
.map(|(t, e)| (t, e.into_iter().map(LinComb::from).collect()))
|
||||
.collect(),
|
||||
),
|
||||
}
|
||||
|
|
|
@ -267,10 +267,10 @@ impl<'ast> From<pest::LogStatement<'ast>> for untyped::StatementNode<'ast> {
|
|||
let expressions = statement
|
||||
.expressions
|
||||
.into_iter()
|
||||
.map(|e| untyped::ExpressionNode::from(e))
|
||||
.map(untyped::ExpressionNode::from)
|
||||
.collect();
|
||||
|
||||
untyped::Statement::Log(&statement.content.span.as_str(), expressions).span(statement.span)
|
||||
untyped::Statement::Log(statement.content.span.as_str(), expressions).span(statement.span)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ use zokrates_field::Field;
|
|||
pub struct LogIgnorer;
|
||||
|
||||
impl LogIgnorer {
|
||||
pub fn ignore<'ast, T: Field>(p: TypedProgram<'ast, T>) -> TypedProgram<'ast, T> {
|
||||
pub fn ignore<T: Field>(p: TypedProgram<T>) -> TypedProgram<T> {
|
||||
Self::default().fold_program(p)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ impl Interpreter {
|
|||
for ((t, e), part) in expressions.into_iter().zip(parts) {
|
||||
let values: Vec<_> = e
|
||||
.iter()
|
||||
.map(|e| evaluate_lin(&witness, &e).unwrap())
|
||||
.map(|e| evaluate_lin(&witness, e).unwrap())
|
||||
.collect();
|
||||
|
||||
write!(log_stream, "{}", Value::decode(values, t).into_serde_json())
|
||||
|
|
Loading…
Reference in a new issue