Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/cheatcodes/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ fn get_artifact_code(state: &Cheatcodes, path: &str, deployed: bool) -> Result<B
.ok_or_else(|| fmt_err!("no bytecode for contract; is it abstract or unlinked?"));
} else {
let path_in_artifacts =
match (file.map(|f| f.to_string_lossy().to_string()), contract_name) {
match (file.map(|f| f.to_string_lossy().into_owned()), contract_name) {
(Some(file), Some(contract_name)) => {
PathBuf::from(format!("{file}/{contract_name}.json"))
}
Expand Down
6 changes: 3 additions & 3 deletions crates/config/src/providers/ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,11 @@ impl Provider for DappHardhatDirProvider<'_> {
let lib = self.0.join("lib");
if node_modules.exists() {
if lib.exists() {
libs.push(lib.file_name().unwrap().to_string_lossy().to_string());
libs.push(lib.file_name().unwrap().to_string_lossy().into_owned());
}
libs.push(node_modules.file_name().unwrap().to_string_lossy().to_string());
libs.push(node_modules.file_name().unwrap().to_string_lossy().into_owned());
} else {
libs.push(lib.file_name().unwrap().to_string_lossy().to_string());
libs.push(lib.file_name().unwrap().to_string_lossy().into_owned());
}

dict.insert("libs".to_string(), libs.into());
Expand Down
2 changes: 1 addition & 1 deletion crates/evm/traces/src/debug/sources.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl SourceData {
match language {
MultiCompilerLanguage::Vyper(_) => {
// Vyper contracts have the same name as the file name.
if let Some(name) = path.file_stem().map(|s| s.to_string_lossy().to_string()) {
if let Some(name) = path.file_stem().map(|s| s.to_string_lossy().into_owned()) {
contract_definitions.push((name, 0..source.len()));
}
}
Expand Down
12 changes: 6 additions & 6 deletions crates/forge/src/cmd/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ fn dump_sources(meta: &Metadata, root: &PathBuf, no_reorg: bool) -> Result<Vec<R
folder_name.to_string_lossy(),
e.file_name().to_string_lossy()
),
path: dest.to_string_lossy().to_string(),
path: dest.to_string_lossy().into_owned(),
});
}
} else {
Expand All @@ -513,8 +513,8 @@ fn dump_sources(meta: &Metadata, root: &PathBuf, no_reorg: bool) -> Result<Vec<R
std::fs::rename(entry.path(), &dest)?;
remappings.push(Remapping {
context: None,
name: folder_name.to_string_lossy().to_string(),
path: dest.to_string_lossy().to_string(),
name: folder_name.to_string_lossy().into_owned(),
path: dest.to_string_lossy().into_owned(),
});
}
} else {
Expand All @@ -525,8 +525,8 @@ fn dump_sources(meta: &Metadata, root: &PathBuf, no_reorg: bool) -> Result<Vec<R
if folder_name != "src" {
remappings.push(Remapping {
context: None,
name: folder_name.to_string_lossy().to_string(),
path: dest.to_string_lossy().to_string(),
name: folder_name.to_string_lossy().into_owned(),
path: dest.to_string_lossy().into_owned(),
});
}
}
Expand All @@ -550,7 +550,7 @@ fn dump_sources(meta: &Metadata, root: &PathBuf, no_reorg: bool) -> Result<Vec<R
} else {
PathBuf::from(&r.path)
};
r.path = new_path.to_string_lossy().to_string();
r.path = new_path.to_string_lossy().into_owned();
}
remappings.push(r);
}
Expand Down
4 changes: 2 additions & 2 deletions crates/forge/src/cmd/selectors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,12 @@ impl SelectorsSubcommands {

if let Some(contract_path) = &mut first_contract.path {
let target_path = canonicalize(&*contract_path)?;
*contract_path = target_path.to_string_lossy().to_string();
*contract_path = target_path.to_string_lossy().into_owned();
compiler = compiler.files([target_path]);
}
if let Some(contract_path) = &mut second_contract.path {
let target_path = canonicalize(&*contract_path)?;
*contract_path = target_path.to_string_lossy().to_string();
*contract_path = target_path.to_string_lossy().into_owned();
compiler = compiler.files([target_path]);
}

Expand Down
2 changes: 1 addition & 1 deletion crates/script/src/verify.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl VerifyBundle {

// Strip artifact profile from contract name when creating contract info.
let contract = ContractInfo {
path: Some(artifact.source.to_string_lossy().to_string()),
path: Some(artifact.source.to_string_lossy().into_owned()),
name: artifact
.name
.strip_suffix(&format!(".{}", &artifact.profile))
Expand Down
6 changes: 3 additions & 3 deletions crates/test-utils/src/script.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ impl ScriptTester {
/// Creates a new instance of a Tester for the `broadcast` test at the given `project_root` by
/// configuring the `TestCommand` with script
pub fn new_broadcast(cmd: TestCommand, endpoint: &str, project_root: &Path) -> Self {
let target_contract = project_root.join(BROADCAST_TEST_PATH).to_string_lossy().to_string();

let target_contract = project_root.join(BROADCAST_TEST_PATH).to_string_lossy().into_owned();
// copy the broadcast test
fs::copy(
Self::testdata_path().join("default/cheats/Broadcast.t.sol"),
Expand All @@ -96,7 +96,7 @@ impl ScriptTester {
/// Creates a new instance of a Tester for the `broadcast` test at the given `project_root` by
/// configuring the `TestCommand` with script without an endpoint
pub fn new_broadcast_without_endpoint(cmd: TestCommand, project_root: &Path) -> Self {
let target_contract = project_root.join(BROADCAST_TEST_PATH).to_string_lossy().to_string();
let target_contract = project_root.join(BROADCAST_TEST_PATH).to_string_lossy().into_owned();

// copy the broadcast test
let testdata = Self::testdata_path();
Expand Down
Loading