diff --git a/.github/workflows/clippy_check.yml b/.github/workflows/clippy_check.yml new file mode 100644 index 0000000..987467f --- /dev/null +++ b/.github/workflows/clippy_check.yml @@ -0,0 +1,20 @@ +on: push +name: Clippy check +jobs: + clippy_check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - id: component + uses: actions-rs/components-nightly@v1 + with: + component: clippy + - uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ steps.component.outputs.toolchain }} + override: true + - run: rustup component add clippy + - uses: actions-rs/clippy-check@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + args: --all-features diff --git a/example/src/lib.rs b/example/src/lib.rs index 6940507..488b58a 100644 --- a/example/src/lib.rs +++ b/example/src/lib.rs @@ -18,6 +18,16 @@ pub fn pid() -> Pid { } } +// Specifically dumb function, just to trigger clippy +pub fn pid_is_valid(pid: Pid) -> bool { + let pid = pid as u32; + if pid < 0 { + return false; + } else { + return true; + } +} + #[cfg(test)] mod tests { use std::process; @@ -28,5 +38,4 @@ mod tests { fn test_pid_is_working() { assert_eq!(pid() as u32, process::id()); } - } \ No newline at end of file