Skip to content

Commit

Permalink
fix: use unwrap_or instead of match
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm committed Jul 11, 2024
1 parent 1ddc411 commit 18dfea2
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions crates/dojo-lang/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ impl DojoContract {
let mut has_storage = false;
let mut has_init = false;

let contract_namespace = match parameters.namespace {
Some(x) => x.to_string(),
None => default_namespace,
};
let contract_namespace = parameters.namespace.unwrap_or(default_namespace);

for (id, value) in [("name", &name.to_string()), ("namespace", &contract_namespace)] {
if !is_name_valid(value) {
Expand Down

0 comments on commit 18dfea2

Please sign in to comment.