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

Check code style with rustfmt on CI #164

Merged
merged 3 commits into from Jul 22, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Expand Up @@ -12,6 +12,7 @@ Check your PR fulfills the following:
- [ ] Tests for the changes have been added / updated.
- [ ] Documentation comments have been added / updated.
- [ ] A changelog entry has been made for the appropriate packages.
- [ ] Format code with the latest stable rustfmt


## Overview
Expand Down
34 changes: 34 additions & 0 deletions .github/workflows/clippy-fmt.yml
@@ -0,0 +1,34 @@
on:
pull_request:
types: [opened, synchronize, reopened]

name: Clippy and rustfmt Check
jobs:
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
components: rustfmt
profile: minimal
override: true
- name: Check with rustfmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check

- uses: actions-rs/toolchain@v1
with:
toolchain: nightly
components: clippy
profile: minimal
override: true
- name: Check with Clippy
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features --all --tests
20 changes: 0 additions & 20 deletions .github/workflows/clippy.yml

This file was deleted.

2 changes: 1 addition & 1 deletion actix-codec/src/bcodec.rs
@@ -1,4 +1,4 @@
use bytes::{Bytes, BytesMut, Buf};
use bytes::{Buf, Bytes, BytesMut};
use std::io;

use super::{Decoder, Encoder};
Expand Down
10 changes: 8 additions & 2 deletions actix-codec/src/framed.rs
Expand Up @@ -271,7 +271,10 @@ impl<T, U> Framed<T, U> {
}

/// Flush write buffer to underlying I/O stream.
pub fn flush<I>(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), U::Error>>
pub fn flush<I>(
mut self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), U::Error>>
where
T: AsyncWrite,
U: Encoder<I>,
Expand Down Expand Up @@ -304,7 +307,10 @@ impl<T, U> Framed<T, U> {
}

/// Flush write buffer and shutdown underlying I/O stream.
pub fn close<I>(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), U::Error>>
pub fn close<I>(
mut self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Result<(), U::Error>>
where
T: AsyncWrite,
U: Encoder<I>,
Expand Down