Skip to content

Commit

Permalink
Add a simple example.
Browse files Browse the repository at this point in the history
  • Loading branch information
iddm committed Oct 26, 2022
1 parent 337055d commit 75b4710
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ jobs:
run: sudo -E /home/runner/.cargo/bin/cargo test --all-features
# run: sudo -E /usr/share/rust/.cargo/bin/cargo test --all-features

- name: Run examples
run: cargo run --example simple

clippy:
name: Run clippy
runs-on: ubuntu-latest
Expand Down
12 changes: 12 additions & 0 deletions examples/simple.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use thread_priority;

fn main() {
let current = thread_priority::get_current_thread_priority().unwrap();
println!("Current thread priority is: {current:?}");
let set_result = thread_priority::set_current_thread_priority(current);
println!(
"Setting this priority again: {:?}",
set_result,
);
assert_eq!(set_result, Ok(()));
}

0 comments on commit 75b4710

Please sign in to comment.