mirror of
https://github.com/ProvableHQ/leo.git
synced 2024-09-20 10:18:35 +03:00
run cargo clippy
This commit is contained in:
parent
dab6629ac0
commit
ce7ac0b443
@ -71,14 +71,6 @@ impl Type {
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
/// Returns true if the type is a tuple.
|
||||
pub fn is_tuple(&self) -> bool {
|
||||
match self {
|
||||
Type::Tuple(_) => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Display for Type {
|
||||
|
@ -59,7 +59,7 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> {
|
||||
// Ensure there are no nested tuples in the return type.
|
||||
if let Type::Tuple(tys) = &input.output {
|
||||
for ty in &tys.0 {
|
||||
self.assert_not_tuple(input.span, &ty);
|
||||
self.assert_not_tuple(input.span, ty);
|
||||
}
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ impl<'a> ProgramVisitor<'a> for TypeChecker<'a> {
|
||||
|
||||
// Ensure there are no tuple typed members.
|
||||
for CircuitMember::CircuitVariable(v, type_) in input.members.iter() {
|
||||
self.assert_not_tuple(v.span, &type_);
|
||||
self.assert_not_tuple(v.span, type_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -50,7 +50,7 @@ impl<'a> StatementVisitor<'a> for TypeChecker<'a> {
|
||||
VariableSymbol {
|
||||
type_: input.type_.clone(),
|
||||
span: input.span(),
|
||||
declaration: declaration.clone(),
|
||||
declaration,
|
||||
},
|
||||
) {
|
||||
self.handler.emit_err(err);
|
||||
|
@ -322,7 +322,7 @@ impl<'a> TypeChecker<'a> {
|
||||
|
||||
/// Emits an error if the type is a tuple.
|
||||
pub(crate) fn assert_not_tuple(&self, span: Span, type_: &Type) {
|
||||
if type_.is_tuple() {
|
||||
if matches!(type_, Type::Tuple(_)) {
|
||||
self.emit_err(TypeCheckerError::tuple_not_allowed(span))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user