Skip to content

Commit 4bba8d3

Browse files
committed
Remove redundant clone
1 parent 8a53c7a commit 4bba8d3

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

crates/forge-runner/src/gas/report.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use crate::gas::stats::GasStats;
22
use cheatnet::trace_data::{CallTrace, CallTraceNode};
3-
use debugging::ContractName as DebuggingContractName;
43
use debugging::ContractsDataStore;
54
use starknet_api::core::{ClassHash, EntryPointSelector};
65
use starknet_api::execution_resources::GasVector;
@@ -105,10 +104,8 @@ impl SingleTestGasInfo {
105104
fn get_contract_name(contracts_data: &ContractsDataStore, class_hash: ClassHash) -> ContractName {
106105
contracts_data
107106
.get_contract_name(&class_hash)
108-
.cloned()
109-
.unwrap_or_else(|| DebuggingContractName("forked contract".to_string()))
110-
.0
111-
.clone()
107+
.map_or("forked contract", |name| name.0.as_str())
108+
.to_string()
112109
}
113110

114111
fn get_selector(contracts_data: &ContractsDataStore, selector: EntryPointSelector) -> Selector {

0 commit comments

Comments
 (0)