From 3b01e5f51f812df1e7bcf5eda6f4c3eab1dcb22b Mon Sep 17 00:00:00 2001 From: xiaofei0800 <54530729+xiaofei0800@users.noreply.github.com> Date: Thu, 23 Nov 2023 19:46:00 +0800 Subject: [PATCH] Enable clippy linter for all packages (#47) - enable clippy linter for apps package - fix found issues in apps package --- .github/workflows/rust.yml | 5 ++++- apps/src/bin/tquic_server.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 06272262..5391f6ce 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,6 +19,9 @@ jobs: with: submodules: 'recursive' + - name: Update rust + run: rustup update + - name: Code format check run: cargo fmt --check @@ -29,7 +32,7 @@ jobs: run: cargo build --all --verbose - name: Code lint check - run: cargo clippy + run: cargo clippy --all -- -D warnings - name: Unit testing run: cargo test --verbose diff --git a/apps/src/bin/tquic_server.rs b/apps/src/bin/tquic_server.rs index 66ba19dd..df71567c 100644 --- a/apps/src/bin/tquic_server.rs +++ b/apps/src/bin/tquic_server.rs @@ -270,7 +270,7 @@ struct ConnectionHandler { impl ConnectionHandler { fn generate_file_path(uri: &str, root: &str) -> path::PathBuf { let uri = path::Path::new(uri); - let mut path = path::PathBuf::from(root.clone()); + let mut path = path::PathBuf::from(root); for c in uri.components() { if let path::Component::Normal(v) = c {