Skip to content
This repository has been archived by the owner on Oct 13, 2023. It is now read-only.

Triggering clippy checks #2

Merged
merged 2 commits into from
Oct 4, 2019
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/clippy_check.yml
Original file line number Diff line number Diff line change
@@ -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
11 changes: 10 additions & 1 deletion example/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -28,5 +38,4 @@ mod tests {
fn test_pid_is_working() {
assert_eq!(pid() as u32, process::id());
}

}