Skip to content

Commit

Permalink
style: smol refactor (#9224)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Oct 29, 2024
1 parent 0c70305 commit 9501589
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions crates/forge/bin/cmd/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,19 @@ impl CreateArgs {
};

// Add arguments to constructor
let provider = utils::get_provider(&config)?;
let params = match abi.constructor {
Some(ref v) => {
let constructor_args =
if let Some(ref constructor_args_path) = self.constructor_args_path {
read_constructor_args_file(constructor_args_path.to_path_buf())?
} else {
self.constructor_args.clone()
};
self.parse_constructor_args(v, &constructor_args)?
}
None => vec![],
let params = if let Some(constructor) = &abi.constructor {
let constructor_args =
self.constructor_args_path.clone().map(read_constructor_args_file).transpose()?;
self.parse_constructor_args(
constructor,
constructor_args.as_deref().unwrap_or(&self.constructor_args),
)?
} else {
vec![]
};

let provider = utils::get_provider(&config)?;

// respect chain, if set explicitly via cmd args
let chain_id = if let Some(chain_id) = self.chain_id() {
chain_id
Expand Down

0 comments on commit 9501589

Please sign in to comment.