From 4489b05dda6c0104f3b4ec66064f249b34d4eeab Mon Sep 17 00:00:00 2001 From: edouard Date: Tue, 15 Nov 2022 18:11:29 +0100 Subject: [PATCH 1/2] fix ci: linter gui --- .github/workflows/main.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b7e9e9f..922e71ed 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -58,7 +58,11 @@ jobs: - name: rustfmt run: cd gui && cargo fmt -- --check - name: clippy - run: cargo clippy --all-features --all-targets -- -D warnings + run: | + sudo apt-get update + && sudo apt-get install --allow-downgrades libudev1=245.4-4ubuntu3 libudev-dev=245.4-4ubuntu3 pkg-config libxkbcommon-dev libvulkan-dev + && cd gui + && cargo clippy --all-features --all-targets -- -D warnings unit_tests_gui: needs: linter_gui @@ -89,4 +93,8 @@ jobs: run: cd gui && cargo test --verbose --color always -- --nocapture - name: Test on Rust ${{ matrix.toolchain }} (non Windows) if: matrix.os == 'ubuntu-latest' - run: sudo apt-get update & sudo apt-get install --allow-downgrades libudev1=245.4-4ubuntu3 libudev-dev=245.4-4ubuntu3 pkg-config libxkbcommon-dev libvulkan-dev && cd gui && cargo test --verbose --color always -- --nocapture + run: | + sudo apt-get update + && sudo apt-get install --allow-downgrades libudev1=245.4-4ubuntu3 libudev-dev=245.4-4ubuntu3 pkg-config libxkbcommon-dev libvulkan-dev + && cd gui + && cargo test --verbose --color always -- --nocapture From 635903118e07e9bc06b07c839e9fb2040ce36874 Mon Sep 17 00:00:00 2001 From: edouard Date: Tue, 15 Nov 2022 18:11:42 +0100 Subject: [PATCH 2/2] gui: fix clippy errors --- .github/workflows/main.yml | 16 ++++++++-------- gui/src/installer/step/descriptor.rs | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 922e71ed..2e83b210 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -59,10 +59,10 @@ jobs: run: cd gui && cargo fmt -- --check - name: clippy run: | - sudo apt-get update - && sudo apt-get install --allow-downgrades libudev1=245.4-4ubuntu3 libudev-dev=245.4-4ubuntu3 pkg-config libxkbcommon-dev libvulkan-dev - && cd gui - && cargo clippy --all-features --all-targets -- -D warnings + sudo apt-get update & + sudo apt-get install --allow-downgrades libudev1=245.4-4ubuntu3 libudev-dev=245.4-4ubuntu3 pkg-config libxkbcommon-dev libvulkan-dev && + cd gui && + cargo clippy --all-features --all-targets -- -D warnings unit_tests_gui: needs: linter_gui @@ -94,7 +94,7 @@ jobs: - name: Test on Rust ${{ matrix.toolchain }} (non Windows) if: matrix.os == 'ubuntu-latest' run: | - sudo apt-get update - && sudo apt-get install --allow-downgrades libudev1=245.4-4ubuntu3 libudev-dev=245.4-4ubuntu3 pkg-config libxkbcommon-dev libvulkan-dev - && cd gui - && cargo test --verbose --color always -- --nocapture + sudo apt-get update & + sudo apt-get install --allow-downgrades libudev1=245.4-4ubuntu3 libudev-dev=245.4-4ubuntu3 pkg-config libxkbcommon-dev libvulkan-dev && + cd gui && + cargo test --verbose --color always -- --nocapture diff --git a/gui/src/installer/step/descriptor.rs b/gui/src/installer/step/descriptor.rs index 1e56da76..b5a77bc9 100644 --- a/gui/src/installer/step/descriptor.rs +++ b/gui/src/installer/step/descriptor.rs @@ -121,7 +121,7 @@ impl Step for DefineDescriptor { self.user_xpub.valid = key.is_ok(); // Check the Network if let Ok(key) = &key { - self.user_xpub.valid = check_key_network(&key, ctx.bitcoin_config.network); + self.user_xpub.valid = check_key_network(key, ctx.bitcoin_config.network); } } @@ -130,7 +130,7 @@ impl Step for DefineDescriptor { self.heir_xpub.valid = key.is_ok(); // Check the Network if let Ok(key) = &key { - self.heir_xpub.valid = check_key_network(&key, ctx.bitcoin_config.network); + self.heir_xpub.valid = check_key_network(key, ctx.bitcoin_config.network); } } @@ -158,13 +158,13 @@ impl Step for DefineDescriptor { let user_key = DescriptorPublicKey::from_str(&self.user_xpub.value); self.user_xpub.valid = user_key.is_ok(); if let Ok(key) = &user_key { - self.user_xpub.valid = check_key_network(&key, ctx.bitcoin_config.network); + self.user_xpub.valid = check_key_network(key, ctx.bitcoin_config.network); } let heir_key = DescriptorPublicKey::from_str(&self.heir_xpub.value); self.heir_xpub.valid = heir_key.is_ok(); if let Ok(key) = &heir_key { - self.heir_xpub.valid = check_key_network(&key, ctx.bitcoin_config.network); + self.heir_xpub.valid = check_key_network(key, ctx.bitcoin_config.network); } let sequence = self.sequence.value.parse::();