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

Commit 585bc8e

Browse files
authored
Triggering clippy checks (#2)
1 parent 0031e99 commit 585bc8e

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

.github/workflows/clippy_check.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on: push
2+
name: Clippy check
3+
jobs:
4+
clippy_check:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v1
8+
- id: component
9+
uses: actions-rs/components-nightly@v1
10+
with:
11+
component: clippy
12+
- uses: actions-rs/toolchain@v1
13+
with:
14+
toolchain: ${{ steps.component.outputs.toolchain }}
15+
override: true
16+
- run: rustup component add clippy
17+
- uses: actions-rs/clippy-check@v1
18+
with:
19+
token: ${{ secrets.GITHUB_TOKEN }}
20+
args: --all-features

example/src/lib.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ pub fn pid() -> Pid {
1818
}
1919
}
2020

21+
// Specifically dumb function, just to trigger clippy
22+
pub fn pid_is_valid(pid: Pid) -> bool {
23+
let pid = pid as u32;
24+
if pid < 0 {
25+
return false;
26+
} else {
27+
return true;
28+
}
29+
}
30+
2131
#[cfg(test)]
2232
mod tests {
2333
use std::process;
@@ -28,5 +38,4 @@ mod tests {
2838
fn test_pid_is_working() {
2939
assert_eq!(pid() as u32, process::id());
3040
}
31-
3241
}

0 commit comments

Comments
 (0)