From b77864d0b309e076669f88369f9b0f9220854b33 Mon Sep 17 00:00:00 2001 From: He1pa <18012015693@163.com> Date: Wed, 11 Oct 2023 15:45:56 +0800 Subject: [PATCH] fmt: fmt code Signed-off-by: He1pa <18012015693@163.com> --- kclvm/tools/src/LSP/src/goto_def.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kclvm/tools/src/LSP/src/goto_def.rs b/kclvm/tools/src/LSP/src/goto_def.rs index 70431d8b7..ebbdb9f0a 100644 --- a/kclvm/tools/src/LSP/src/goto_def.rs +++ b/kclvm/tools/src/LSP/src/goto_def.rs @@ -338,8 +338,8 @@ pub(crate) fn resolve_var( if names.len() == 2 { let func_name_node = node_names[1].clone(); let func_name = func_name_node.node.clone(); - match STRING_MEMBER_FUNCTIONS.get(&func_name) { - Some(ty) => match &ty.kind { + if let Some(ty) = STRING_MEMBER_FUNCTIONS.get(&func_name) { + match &ty.kind { kclvm_sema::ty::TypeKind::Function(func_ty) => { return Some(Definition::Object(ScopeObject { name: func_name, @@ -352,8 +352,7 @@ pub(crate) fn resolve_var( } // unreachable _ => {} - }, - None => {} + } } } None