Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
tarrencev committed Mar 8, 2024
1 parent 5b2eeef commit 5415aef
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions crates/dojo-lang/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -308,24 +308,26 @@ impl DojoContract {
{
let has_good_pos = (add_self && idx == 0) || (!add_self && idx == 1);
let has_good_name = name.eq(&"world".to_string());

if has_good_pos && has_good_name {
world_removed = true;
None
}
else {
} else {
if !has_good_pos {
self.diagnostics.push(PluginDiagnostic {
stable_ptr: param.stable_ptr().untyped(),
message: "The IWorldDispatcher parameter must be the first parameter of the function (self excluded).".to_string(),
message: "The IWorldDispatcher parameter must be the first \
parameter of the function (self excluded)."
.to_string(),
severity: Severity::Error,
});
}

if !has_good_name {
self.diagnostics.push(PluginDiagnostic {
stable_ptr: param.stable_ptr().untyped(),
message: "The IWorldDispatcher parameter must be named 'world'.".to_string(),
message: "The IWorldDispatcher parameter must be named 'world'."
.to_string(),
severity: Severity::Error,
});
}
Expand Down

0 comments on commit 5415aef

Please sign in to comment.