From 806090e5cc032018c987e6315a87598520cc0387 Mon Sep 17 00:00:00 2001 From: Ashar Date: Sun, 23 Nov 2025 13:44:10 +0530 Subject: [PATCH] chore(misc): ci activities and lint fixes (#97) --- .github/workflows/ci.yml | 2 ++ Cargo.lock | 2 +- src/workspace/workspace_symbol.rs | 21 ++++++++++----------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index faac89c..01ff261 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,3 +20,5 @@ jobs: run: cargo build --verbose - name: Run tests run: cargo test --verbose + - name: Run lints + run: cargo clippy --all-targets -- -D warnings diff --git a/Cargo.lock b/Cargo.lock index 5b95e2b..5878482 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -879,7 +879,7 @@ dependencies = [ [[package]] name = "protols" -version = "0.12.9" +version = "0.13.0" dependencies = [ "async-lsp", "basic-toml", diff --git a/src/workspace/workspace_symbol.rs b/src/workspace/workspace_symbol.rs index 5a57b15..45da1f6 100644 --- a/src/workspace/workspace_symbol.rs +++ b/src/workspace/workspace_symbol.rs @@ -1,7 +1,6 @@ #[cfg(test)] mod test { use insta::assert_yaml_snapshot; - use insta::internals::{Content, ContentPath}; use crate::config::Config; use crate::state::ProtoLanguageState; @@ -10,22 +9,22 @@ mod test { fn test_workspace_symbols() { let current_dir = std::env::current_dir().unwrap(); let ipath = vec![current_dir.join("src/workspace/input")]; - let a_uri = (&format!( + let a_uri = format!( "file://{}/src/workspace/input/a.proto", current_dir.to_str().unwrap() - )) + ) .parse() .unwrap(); - let b_uri = (&format!( + let b_uri = format!( "file://{}/src/workspace/input/b.proto", current_dir.to_str().unwrap() - )) + ) .parse() .unwrap(); - let c_uri = (&format!( + let c_uri = format!( "file://{}/src/workspace/input/c.proto", current_dir.to_str().unwrap() - )) + ) .parse() .unwrap(); @@ -49,7 +48,7 @@ mod test { ); format!( "file:///src/workspace/input/{}", - c.as_str().unwrap().split('/').last().unwrap() + c.as_str().unwrap().split('/').next_back().unwrap() ) })}); @@ -65,7 +64,7 @@ mod test { ); format!( "file:///src/workspace/input/{}", - c.as_str().unwrap().split('/').last().unwrap() + c.as_str().unwrap().split('/').next_back().unwrap() ) })}); @@ -75,11 +74,11 @@ mod test { assert!( c.as_str() .unwrap() - .contains(¤t_dir.to_str().unwrap()) + .contains(current_dir.to_str().unwrap()) ); format!( "file:///src/workspace/input/{}", - c.as_str().unwrap().split('/').last().unwrap() + c.as_str().unwrap().split('/').next_back().unwrap() ) })});