Skip to content

Commit e3ea9cb

Browse files
committed
clippy
1 parent 8996aa2 commit e3ea9cb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

server/src/http/dyn_contract.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ impl ContractCall {
198198
fn extract_function_name(&self, method: &str) -> Result<String, EngineError> {
199199
let trimmed = method.trim();
200200

201-
if trimmed.starts_with("function ") {
202-
let after_function = &trimmed[9..];
201+
if let Some(after_function) = trimmed.strip_prefix("function ") {
203202
if let Some(paren_pos) = after_function.find('(') {
204203
return Ok(after_function[..paren_pos].trim().to_string());
205204
}

0 commit comments

Comments
 (0)