We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4ae7132 commit c5f18b6Copy full SHA for c5f18b6
cli/src/cmd/create.rs
@@ -108,7 +108,13 @@ impl CreateArgs {
108
let mut contract_artifact = None;
109
110
for (name, artifact) in compiled.into_artifacts() {
111
- let artifact_contract_name = name.split(':').collect::<Vec<_>>()[1];
+ // if the contract name
112
+ let mut split = name.split(':');
113
+ let mut artifact_contract_name =
114
+ split.next().ok_or_else(|| eyre::Error::msg("no contract name provided"))?;
115
+ if let Some(new_name) = split.next() {
116
+ artifact_contract_name = new_name;
117
+ };
118
119
if artifact_contract_name == self.contract.name {
120
if has_found_contract {
0 commit comments