Skip to content

Commit

Permalink
clippy and fmt issues
Browse files Browse the repository at this point in the history
  • Loading branch information
xunilrj committed Sep 7, 2024
1 parent ece3e96 commit 8d2f1b8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions sway-core/src/language/ty/expression/expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl TypeCheckAnalysis for TyExpression {
}
}
TyExpressionVariant::Array { .. } => {
self.as_array_unify_elements(&handler, &ctx.engines);
self.as_array_unify_elements(handler, ctx.engines);
}
_ => {}
}
Expand Down Expand Up @@ -502,7 +502,7 @@ impl TyExpression {

let h = Handler::default();
unify.unify(&h, element.return_type, *elem_type, &element.span, true);

// unification error points to type that failed
// we want to report the element type instead
if h.has_errors() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1873,9 +1873,9 @@ impl ty::TyExpression {
// if the element type is still unknown, and all elements are Never,
// fallback to unit
let initial_type = if matches!(initial_type, TypeInfo::Unknown) {
let is_all_elements_never = typed_contents.iter().all(|expr| {
matches!(&*engines.te().get(expr.return_type), TypeInfo::Never)
});
let is_all_elements_never = typed_contents
.iter()
.all(|expr| matches!(&*engines.te().get(expr.return_type), TypeInfo::Never));
if is_all_elements_never {
TypeInfo::Tuple(vec![])
} else {
Expand Down Expand Up @@ -1910,7 +1910,7 @@ impl ty::TyExpression {

// type_check_analyze unification will give the final error
let handler = Handler::default();
expr.as_array_unify_elements(&handler, &ctx.engines);
expr.as_array_unify_elements(&handler, ctx.engines);

Ok(expr)
}
Expand Down

0 comments on commit 8d2f1b8

Please sign in to comment.