Skip to content
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

Add clippy to CI #3153

Closed
wants to merge 3 commits into from
Closed
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
18 changes: 17 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- ffi-header
- doc
- check-external-types
- clippy
steps:
- run: exit 0

Expand Down Expand Up @@ -218,7 +219,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@master
Expand All @@ -234,3 +235,18 @@ jobs:

- name: check-external-types
run: cargo check-external-types --config .github/workflows/external-types.toml

clippy:
name: Run clippy
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy

- name: Run check
run: cargo clippy -- -Aclippy::all -Dclippy::self_named_module_files
10 changes: 3 additions & 7 deletions src/body/incoming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,9 @@ impl Body for Incoming {
want_tx.send(WANT_READY);

if !data_rx.is_terminated() {
match ready!(Pin::new(data_rx).poll_next(cx)?) {
Some(chunk) => {
len.sub_if(chunk.len() as u64);
return Poll::Ready(Some(Ok(Frame::data(chunk))));
}
// fall through to trailers
None => (),
if let Some(chunk) = ready!(Pin::new(data_rx).poll_next(cx)?) {
len.sub_if(chunk.len() as u64);
return Poll::Ready(Some(Ok(Frame::data(chunk))));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ impl Error {
pub(crate) fn find_source<E: StdError + 'static>(&self) -> Option<&E> {
let mut cause = self.source();
while let Some(err) = cause {
if let Some(ref typed) = err.downcast_ref() {
if let Some(typed) = err.downcast_ref() {
return Some(typed);
}
cause = err.source();
Expand Down
Loading