Skip to content

Commit 3791d61

Browse files
authored
fix: correct comment for Git::has_submodules and remove_contract (#12530)
* fix(cli): clarify remove_contract docs * Fix doc comment for Git::has_submodules to match behavior * rename function * rename * cargo fmt
1 parent c8ff851 commit 3791d61

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

crates/cli/src/utils/cmd.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ use std::{
2222
};
2323
use yansi::Paint;
2424

25-
/// Given a `Project`'s output, removes the matching ABI, Bytecode and
26-
/// Runtime Bytecode of the given contract.
25+
/// Given a `Project`'s output, finds the contract by path and name and returns its
26+
/// ABI, creation bytecode, and `ArtifactId`.
2727
#[track_caller]
28-
pub fn remove_contract(
28+
pub fn find_contract_artifacts(
2929
output: ProjectCompileOutput,
3030
path: &Path,
3131
name: &str,

crates/cli/src/utils/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ ignore them in the `.gitignore` file."
630630
.map(|stdout| stdout.lines().any(|line| line.starts_with('-')))
631631
}
632632

633-
/// Returns true if the given path has no submodules by checking `git submodule status`
633+
/// Returns true if the given path has submodules by checking `git submodule status`
634634
pub fn has_submodules<I, S>(self, paths: I) -> Result<bool>
635635
where
636636
I: IntoIterator<Item = S>,

crates/forge/src/cmd/create.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use eyre::{Context, Result};
1414
use forge_verify::{RetryArgs, VerifierArgs, VerifyArgs};
1515
use foundry_cli::{
1616
opts::{BuildOpts, EthereumOpts, EtherscanOpts, TransactionOpts},
17-
utils::{self, LoadConfig, read_constructor_args_file, remove_contract},
17+
utils::{self, LoadConfig, find_contract_artifacts, read_constructor_args_file},
1818
};
1919
use foundry_common::{
2020
compile::{self},
@@ -123,7 +123,7 @@ impl CreateArgs {
123123

124124
let output = compile::compile_target(&target_path, &project, shell::is_json())?;
125125

126-
let (abi, bin, id) = remove_contract(output, &target_path, &self.contract.name)?;
126+
let (abi, bin, id) = find_contract_artifacts(output, &target_path, &self.contract.name)?;
127127

128128
let bin = match bin.object {
129129
BytecodeObject::Bytecode(_) => bin.object,

0 commit comments

Comments
 (0)