Skip to content

chore: Add clippy to ci #1189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,26 @@ jobs:
- name: Check all targets
run: cargo check --all --all-targets --all-features

clippy:
name: cargo clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Rust and clippy
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: "1.60"
override: true
components: clippy
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- uses: Swatinem/rust-cache@v2
- name: Run cargo clippy
run: cargo clippy --workspace --all-targets --all-features -- --allow unknown_lints --deny warnings

deny-check:
name: cargo-deny check
runs-on: ubuntu-latest
Expand Down
10 changes: 4 additions & 6 deletions tonic-types/src/richer_error/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,12 +459,10 @@ impl StatusExt for tonic::Status {
let status = pb::Status::decode(self.details()).ok()?;

for any in status.details.into_iter() {
match any.type_url.as_str() {
DebugInfo::TYPE_URL => match DebugInfo::from_any(any) {
Ok(detail) => return Some(detail),
Err(_) => {}
},
_ => {}
if any.type_url.as_str() == DebugInfo::TYPE_URL {
if let Ok(detail) = DebugInfo::from_any(any) {
return Some(detail);
}
}
}

Expand Down