Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mhasel committed Oct 17, 2024
1 parent bf2b90c commit 7a1d890
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/validation/variable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,15 @@ fn validate_variable<T: AnnotationMap>(
};

let Some(rhs_ty) = context.annotations.get_type(node, context.index) else {
let type_name = init
.target_type_name
.as_ref()
.map(Clone::clone)
.unwrap_or_default();
validator.push_diagnostic(Diagnostic::unknown_type(&type_name, node.get_location()));
let type_name = init.target_type_name.clone().unwrap_or_default();
validator
.push_diagnostic(Diagnostic::unknown_type(&type_name, node.get_location()));
return;
};

if context.index.find_elementary_pointer_type(rhs_ty.get_type_information()).is_void() {
// we could not find the type in the index, this will be caught elsewhere.
if context.index.find_elementary_pointer_type(rhs_ty.get_type_information()).is_void()
{
// we could not find the type in the index, a validation for this exists elsewhere
return;
};

Expand Down

0 comments on commit 7a1d890

Please sign in to comment.