diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..f09d934 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,48 @@ +name: Pull Request + +on: + pull_request: + branches: [ main ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + strategy: + matrix: + include: + - sdk-redist-ref: gemini + cargo-features: --no-default-features --features gemini + - sdk-redist-ref: orion + cargo-features: --no-default-features + name: check + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v1 + - name: Check + run: cargo check ${{ matrix.cargo-features }} + - name: Check Examples + run: cargo check ${{ matrix.cargo-features }} --examples + - name: Check Tests + run: cargo check ${{ matrix.cargo-features }} --tests + - name: Doc + run: cargo doc + - name: Style + run: cargo fmt -- --check + - name: Clippy + run: cargo clippy -- -D warnings + + dependabot: + name: 'Dependabot' + needs: [build] + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' && github.event_name == 'pull_request'}} # Detect that the PR author is dependabot + steps: + - name: Enable auto-merge for Dependabot PRs + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7aaa99b..2ef993f 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -3,8 +3,6 @@ name: CI on: push: branches: [ main ] - pull_request: - branches: [ main ] create: tags: - v* diff --git a/Cargo.lock b/Cargo.lock index cc7fdbd..696eb7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -298,7 +298,7 @@ checksum = "23603c7542c3b4b3b6fd83c7fe267a744f33573ec242ef150f4388e12ae52562" [[package]] name = "leaprs" -version = "0.0.8-dev" +version = "0.0.9-dev" dependencies = [ "bitflags", "image", diff --git a/Cargo.toml b/Cargo.toml index f7c2060..6e3426c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "leaprs" -version = "0.0.8-dev" +version = "0.0.9-dev" edition = "2021" authors = ["Pierre Lulé "] description = "Safe wrapper for the LeapC Ultraleap (Leap Motion) hand tracking device API." diff --git a/src/digit.rs b/src/digit.rs index 9488ed1..19f4a1d 100644 --- a/src/digit.rs +++ b/src/digit.rs @@ -54,7 +54,7 @@ impl<'a> Digit<'a> { } #[doc = " Reports whether the finger is more or less straight. @since 3.0.0"] - pub fn is_extended(&self) -> u32 { - self.handle.is_extended + pub fn is_extended(&self) -> bool { + self.handle.is_extended == 1 } }