Skip to content

Commit

Permalink
chore: Add clippy to ci (#1189)
Browse files Browse the repository at this point in the history
  • Loading branch information
tottoto authored Dec 14, 2022
1 parent bf22a74 commit 4e5c0b2
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 6 deletions.
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

0 comments on commit 4e5c0b2

Please sign in to comment.