From 49b676c4d92546781d0d74b3e668f5923fac2fba Mon Sep 17 00:00:00 2001 From: Liu-Cheng Xu Date: Sun, 31 Mar 2024 22:00:11 +0800 Subject: [PATCH] fix clippy --- .../src/stdio_server/provider/hooks/on_move.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/crates/maple_core/src/stdio_server/provider/hooks/on_move.rs b/crates/maple_core/src/stdio_server/provider/hooks/on_move.rs index 5502c77ac..eef32409d 100644 --- a/crates/maple_core/src/stdio_server/provider/hooks/on_move.rs +++ b/crates/maple_core/src/stdio_server/provider/hooks/on_move.rs @@ -734,13 +734,8 @@ async fn find_code_context( path: &Path, ) -> Option { // Some checks against the latest preview line. - let Some(line) = lines.get(highlight_lnum - 1) else { - return None; - }; - - let Some(ext) = path.extension().and_then(|e| e.to_str()) else { - return None; - }; + let line = lines.get(highlight_lnum - 1)?; + let ext = path.extension().and_then(|e| e.to_str())?; let skip_context_tag = { const BLACK_LIST: &[&str] = &["log", "txt", "lock", "toml", "yaml", "mod", "conf"];