Skip to content

Commit

Permalink
Check code style with rustfmt on CI (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Jul 22, 2020
1 parent 0dca1a7 commit 8ace926
Show file tree
Hide file tree
Showing 13 changed files with 343 additions and 293 deletions.
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

0 comments on commit 8ace926

Please sign in to comment.