From 964162968ffffaae8d42148ce1ab17bfffaa94fc Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:38:19 +0300 Subject: [PATCH] chore(deps): update rust crate winit to 0.29 (#93) * chore(deps): update rust crate winit to 0.29 * update actions * clippy --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: amrbashir --- .github/workflows/audit.yml | 5 +-- .github/workflows/clippy-fmt.yml | 40 ++++++++----------- ...e-status-on-PR.yml => covector-status.yml} | 4 +- .../workflows/covector-version-or-publish.yml | 11 ++--- .github/workflows/test.yml | 20 +++------- Cargo.toml | 2 +- examples/winit.rs | 8 ++-- src/platform_impl/windows/mod.rs | 2 + 8 files changed, 39 insertions(+), 53 deletions(-) rename .github/workflows/{change-status-on-PR.yml => covector-status.yml} (84%) diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 555adad..fd10e86 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -27,8 +27,7 @@ jobs: audit: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: rust audit - uses: actions-rs/audit-check@v1 + - uses: actions/checkout@v4 + - uses: rustsec/audit-check@v1 with: token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/clippy-fmt.yml b/.github/workflows/clippy-fmt.yml index a5e26ca..8065661 100644 --- a/.github/workflows/clippy-fmt.yml +++ b/.github/workflows/clippy-fmt.yml @@ -11,44 +11,38 @@ on: pull_request: concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: clippy: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + platform: [ubuntu-latest, macos-latest, windows-latest] + + runs-on: ${{ matrix.platform }} + steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: install system deps + if: matrix.platform == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev libxdo-dev libayatana-appindicator3-dev - - name: install stable - uses: actions-rs/toolchain@v1 + + - uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable - override: true components: clippy - - uses: actions-rs/cargo@v1 - with: - command: clippy - args: --all-targets --all-features -- -D warnings + - run: cargo clippy --all-targets --all-features -- -D warnings fmt: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: install stable - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v4 + - uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable - override: true components: rustfmt - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check \ No newline at end of file + - run: cargo fmt --all -- --check diff --git a/.github/workflows/change-status-on-PR.yml b/.github/workflows/covector-status.yml similarity index 84% rename from .github/workflows/change-status-on-PR.yml rename to .github/workflows/covector-status.yml index 526f734..aaa9217 100644 --- a/.github/workflows/change-status-on-PR.yml +++ b/.github/workflows/covector-status.yml @@ -10,9 +10,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - uses: actions/checkout@v4 - name: covector status uses: jbolda/covector/packages/action@covector-v0 id: covector diff --git a/.github/workflows/covector-version-or-publish.yml b/.github/workflows/covector-version-or-publish.yml index ff110c0..a3f38a6 100644 --- a/.github/workflows/covector-version-or-publish.yml +++ b/.github/workflows/covector-version-or-publish.yml @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: MIT -name: version or publish +name: covector version or publish on: push: @@ -19,12 +19,11 @@ jobs: successfulPublish: ${{ steps.covector.outputs.successfulPublish }} steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 + - uses: actions/checkout@v4 - name: cargo login run: cargo login ${{ secrets.ORG_CRATES_IO_TOKEN }} + - name: git config run: | git config --global user.name "${{ github.event.pusher.name }}" @@ -33,6 +32,8 @@ jobs: - name: covector version or publish (publish when no change files present) uses: jbolda/covector/packages/action@covector-v0 id: covector + env: + NODE_AUTH_TOKEN: ${{ secrets.ORG_NPM_TOKEN }} with: token: ${{ secrets.GITHUB_TOKEN }} command: 'version-or-publish' @@ -43,8 +44,8 @@ jobs: uses: tauri-apps/create-pull-request@v3 with: token: ${{ secrets.GITHUB_TOKEN }} - branch: release/version-updates title: Apply Version Updates From Current Changes commit-message: 'apply version updates' labels: 'version updates' + branch: 'release' body: ${{ steps.covector.outputs.change }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a96caae..208b497 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,26 +22,18 @@ jobs: strategy: fail-fast: false matrix: - os: ["windows-latest", "macos-latest", "ubuntu-latest"] + platform: ["windows-latest", "macos-latest", "ubuntu-latest"] - runs-on: ${{ matrix.os }} + runs-on: ${{ matrix.platform }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: install system deps - if: contains(matrix.os, 'ubuntu') + if: matrix.platform == 'ubuntu-latest' run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev libxdo-dev libayatana-appindicator3-dev - - name: install stable - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - - uses: actions-rs/cargo@v1 - with: - command: test + - uses: dtolnay/rust-toolchain@stable + - run: cargo test diff --git a/Cargo.toml b/Cargo.toml index 1e7b45d..50e1c45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ core-graphics = "0.23.1" png = "0.17" [dev-dependencies] -winit = "0.28" +winit = "0.29" tao = "0.22" image = "0.24" eframe = "0.23" diff --git a/examples/winit.rs b/examples/winit.rs index b2a7812..0c517c1 100644 --- a/examples/winit.rs +++ b/examples/winit.rs @@ -31,7 +31,7 @@ fn main() { gtk::main(); }); - let event_loop = EventLoopBuilder::new().build(); + let event_loop = EventLoopBuilder::new().build().unwrap(); #[cfg(not(target_os = "linux"))] let mut tray_icon = Some( @@ -46,13 +46,13 @@ fn main() { let menu_channel = MenuEvent::receiver(); let tray_channel = TrayIconEvent::receiver(); - event_loop.run(move |_event, _, control_flow| { - *control_flow = ControlFlow::Poll; + event_loop.run(move |_event, event_loop| { + event_loop.set_control_flow(ControlFlow::Poll); if let Ok(event) = tray_channel.try_recv() { println!("{event:?}"); } - }) + }); } fn load_icon(path: &std::path::Path) -> tray_icon::Icon { diff --git a/src/platform_impl/windows/mod.rs b/src/platform_impl/windows/mod.rs index c62cca8..6a76062 100644 --- a/src/platform_impl/windows/mod.rs +++ b/src/platform_impl/windows/mod.rs @@ -209,6 +209,7 @@ impl TrayIcon { }; if let Some(tooltip) = &tooltip { let tip = util::encode_wide(tooltip.as_ref()); + #[allow(clippy::manual_memcpy)] for i in 0..tip.len().min(128) { nid.szTip[i] = tip[i]; } @@ -410,6 +411,7 @@ unsafe fn register_tray_icon( if let Some(tooltip) = tooltip { flags |= NIF_TIP; let tip = util::encode_wide(tooltip); + #[allow(clippy::manual_memcpy)] for i in 0..tip.len().min(128) { sz_tip[i] = tip[i]; }