From 32f8dfb3299cffa1e43c7ff9e953949578b964cf Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Fri, 21 Apr 2023 15:22:42 +0200 Subject: [PATCH 1/4] =?UTF-8?q?ci:=20=E2=9C=A8=20Update=20actions=20to=20a?= =?UTF-8?q?void=20nodejs12?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 27 +++++++-------------------- .github/workflows/release.yaml | 4 +--- 2 files changed, 8 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e298b65..20f05f5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,22 +9,14 @@ jobs: name: janitorial runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: actions/checkout@v3 + - uses: dtolnay/rust-toolchain@v1 with: toolchain: stable - profile: minimal components: clippy - override: true - - uses: actions-rs/clippy-check@v1 - with: - toolchain: stable - token: ${{ secrets.GITHUB_TOKEN }} - args: --all-targets --all-features -- -D warnings - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --check + - run: cargo clippy --all-targets --all-features -- -D warnings + - run: cargo fmt --check + test: name: test runs-on: ${{ matrix.os }} @@ -45,13 +37,8 @@ jobs: target: x86_64-pc-windows-msvc steps: - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@v1 with: toolchain: ${{ matrix.rust }} target: ${{ matrix.target }} - override: true - - uses: actions-rs/cargo@v1 - with: - use-cross: true - command: test - args: --release --target=${{ matrix.target }} + - run: cargo test --release --target=${{ matrix.target }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index d1f1732..f2085ae 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -12,10 +12,8 @@ jobs: run: | sudo apt install -y curl jq - uses: actions/checkout@v2 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@v1 with: toolchain: stable - profile: minimal - override: true - name: Publish release run: ./.github/release.sh ${{ secrets.CRATES_IO_TOKEN }} From f8c4eaf0efe60ae5d97d4c9328636f62735f84bc Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Fri, 21 Apr 2023 15:23:17 +0200 Subject: [PATCH 2/4] =?UTF-8?q?ci:=20=E2=AC=86=EF=B8=8F=20Bump=20checkout?= =?UTF-8?q?=20action=20version?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ci.yaml | 2 +- .github/workflows/release.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 20f05f5..45552b7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -36,7 +36,7 @@ jobs: - os: windows-latest target: x86_64-pc-windows-msvc steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@v1 with: toolchain: ${{ matrix.rust }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index f2085ae..acfdda9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -11,7 +11,7 @@ jobs: - name: Install dependencies run: | sudo apt install -y curl jq - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: dtolnay/rust-toolchain@v1 with: toolchain: stable From cf8bbffbc291b91a0823af5e54fa260bde4e4b31 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Fri, 21 Apr 2023 15:28:30 +0200 Subject: [PATCH 3/4] =?UTF-8?q?style:=20=E2=9A=A1=EF=B8=8F=20Fix=20clippy?= =?UTF-8?q?=20warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- espmonitor/src/types.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/espmonitor/src/types.rs b/espmonitor/src/types.rs index 3ac95e0..90cb054 100644 --- a/espmonitor/src/types.rs +++ b/espmonitor/src/types.rs @@ -23,7 +23,9 @@ use std::{ }; #[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)] +#[derive(Default)] pub enum Framework { + #[default] Baremetal, EspIdf, } @@ -58,14 +60,12 @@ impl TryFrom<&str> for Framework { } } -impl Default for Framework { - fn default() -> Self { - Framework::Baremetal - } -} + #[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)] +#[derive(Default)] pub enum Chip { + #[default] ESP32, ESP32S2, ESP8266, @@ -132,11 +132,7 @@ impl TryFrom<&str> for Chip { } } -impl Default for Chip { - fn default() -> Self { - Chip::ESP32 - } -} + #[derive(Parser, Debug)] #[command(author, version, about)] From d41d596d22dc78dee801809bbbbe313477d97ab8 Mon Sep 17 00:00:00 2001 From: Sergio Gasquez Date: Fri, 21 Apr 2023 15:29:41 +0200 Subject: [PATCH 4/4] =?UTF-8?q?style:=20=F0=9F=8E=A8=20Fix=20format?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- espmonitor/src/types.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/espmonitor/src/types.rs b/espmonitor/src/types.rs index 90cb054..c00be79 100644 --- a/espmonitor/src/types.rs +++ b/espmonitor/src/types.rs @@ -22,8 +22,7 @@ use std::{ io::{Error as IoError, ErrorKind}, }; -#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)] -#[derive(Default)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum, Default)] pub enum Framework { #[default] Baremetal, @@ -60,10 +59,7 @@ impl TryFrom<&str> for Framework { } } - - -#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum)] -#[derive(Default)] +#[derive(Debug, Clone, Copy, PartialEq, Eq, ValueEnum, Default)] pub enum Chip { #[default] ESP32, @@ -132,8 +128,6 @@ impl TryFrom<&str> for Chip { } } - - #[derive(Parser, Debug)] #[command(author, version, about)] pub struct AppArgs {