From 7da58690b272af5be06cde74b173e2581eea00f0 Mon Sep 17 00:00:00 2001 From: Boyu Yang Date: Fri, 12 Jan 2024 14:31:55 +0800 Subject: [PATCH 1/2] ci: upgrade ci deps --- .github/workflows/ci.yaml | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 987f3fa..04d904b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -16,13 +16,11 @@ jobs: name: Checks / Format runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - profile: minimal toolchain: 1.58.1 - override: true components: rustfmt - name: Run run: make fmt @@ -30,13 +28,11 @@ jobs: name: Checks / Clippy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - profile: minimal toolchain: 1.71.1 - override: true components: clippy - name: Run run: make clippy @@ -45,13 +41,11 @@ jobs: needs: [ rustfmt, clippy ] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - profile: minimal toolchain: 1.56.1 # MSRV - override: true - name: Run run: make ci-msrv test-crates: @@ -59,13 +53,11 @@ jobs: needs: [ rustfmt, clippy ] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - profile: minimal toolchain: 1.58.1 - override: true - name: Run run: make ci-crates test-examples: @@ -73,13 +65,11 @@ jobs: needs: [ rustfmt, clippy ] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup - uses: actions-rs/toolchain@v1 + uses: actions-rust-lang/setup-rust-toolchain@v1 with: - profile: minimal toolchain: 1.58.1 - override: true - name: Run run: make ci-examples success: From 6b4d19113c3c27e52783e5575eb89f6fbf4cb040 Mon Sep 17 00:00:00 2001 From: Boyu Yang Date: Fri, 12 Jan 2024 14:48:55 +0800 Subject: [PATCH 2/2] chore: apply suggestions from latest toolchain and update ci script --- .github/workflows/ci.yaml | 8 ++++---- .../codegen/src/generator/languages/c/mod.rs | 2 +- .../src/generator/languages/rust/mod.rs | 20 +++++++++---------- tools/codegen/src/parser/mod.rs | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 04d904b..0b3e84c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,7 +20,7 @@ jobs: - name: Setup uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.58.1 + toolchain: 1.75.0 components: rustfmt - name: Run run: make fmt @@ -32,7 +32,7 @@ jobs: - name: Setup uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.71.1 + toolchain: 1.75.0 components: clippy - name: Run run: make clippy @@ -57,7 +57,7 @@ jobs: - name: Setup uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.58.1 + toolchain: 1.75.0 - name: Run run: make ci-crates test-examples: @@ -69,7 +69,7 @@ jobs: - name: Setup uses: actions-rust-lang/setup-rust-toolchain@v1 with: - toolchain: 1.58.1 + toolchain: 1.75.0 - name: Run run: make ci-examples success: diff --git a/tools/codegen/src/generator/languages/c/mod.rs b/tools/codegen/src/generator/languages/c/mod.rs index 8faa078..8ac4792 100644 --- a/tools/codegen/src/generator/languages/c/mod.rs +++ b/tools/codegen/src/generator/languages/c/mod.rs @@ -5,7 +5,7 @@ use case::CaseExt; use crate::{ast, C_API_VERSION_MIN, VERSION}; #[macro_use] -pub(self) mod utilities; +mod utilities; mod import; diff --git a/tools/codegen/src/generator/languages/rust/mod.rs b/tools/codegen/src/generator/languages/rust/mod.rs index 86bebb3..04d6177 100644 --- a/tools/codegen/src/generator/languages/rust/mod.rs +++ b/tools/codegen/src/generator/languages/rust/mod.rs @@ -4,29 +4,29 @@ use quote::quote; use crate::{ast, VERSION}; -pub(self) mod utilities; +mod utilities; -pub(self) mod builder; -pub(self) mod entity; -pub(self) mod reader; +mod builder; +mod entity; +mod reader; /// Constants for `{ Entity, Reader }` -pub(self) mod display; +mod display; /// Constants for `{ Entity, Reader, Builder }` -pub(self) mod constants; +mod constants; /// Constants for `{ Entity, Reader }` -pub(self) mod properties; +mod properties; /// Constants for `{ Entity, Reader }` -pub(self) mod getters; +mod getters; /// Iterator for `{ Union } x { Entity, Reader }` -pub(self) mod iterator; +mod iterator; /// Enumerator for `{ Vector } x { Entity, Reader }` -pub(self) mod enumerator; +mod enumerator; mod import; use import::GenImport as _; diff --git a/tools/codegen/src/parser/mod.rs b/tools/codegen/src/parser/mod.rs index 0cc04e2..a5a1fe3 100644 --- a/tools/codegen/src/parser/mod.rs +++ b/tools/codegen/src/parser/mod.rs @@ -246,7 +246,7 @@ union Foo { let ast0 = Parser::parse(&schema_file0.into_temp_path()); let ast1 = Parser::parse(&schema_file1.into_temp_path()); - for ast in vec![ast0, ast1] { + for ast in [ast0, ast1] { // get union items if let TopDecl::Union(union) = ast .decls()