diff --git a/crates/cheatcodes/src/fs.rs b/crates/cheatcodes/src/fs.rs index 193215e1861f7..ed1df3e50ccd3 100644 --- a/crates/cheatcodes/src/fs.rs +++ b/crates/cheatcodes/src/fs.rs @@ -514,7 +514,7 @@ fn get_artifact_code(state: &Cheatcodes, path: &str, deployed: bool) -> Result { PathBuf::from(format!("{file}/{contract_name}.json")) } diff --git a/crates/config/src/providers/ext.rs b/crates/config/src/providers/ext.rs index e5d2d6e3ade81..d54bc747210b2 100644 --- a/crates/config/src/providers/ext.rs +++ b/crates/config/src/providers/ext.rs @@ -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()); diff --git a/crates/evm/traces/src/debug/sources.rs b/crates/evm/traces/src/debug/sources.rs index 18ed9e0f4ef9d..8f110375d9147 100644 --- a/crates/evm/traces/src/debug/sources.rs +++ b/crates/evm/traces/src/debug/sources.rs @@ -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())); } } diff --git a/crates/forge/src/cmd/clone.rs b/crates/forge/src/cmd/clone.rs index 6cf3db9ff7ae9..fdba554c6cf7a 100644 --- a/crates/forge/src/cmd/clone.rs +++ b/crates/forge/src/cmd/clone.rs @@ -494,7 +494,7 @@ fn dump_sources(meta: &Metadata, root: &PathBuf, no_reorg: bool) -> Result Result Result Result 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"), @@ -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();