Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(pilota-build): don't derive eq for nested list double #292

Merged
merged 2 commits into from
Dec 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 40 additions & 40 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: 'CI'
name: "CI"
on:
pull_request:
push:
Expand Down Expand Up @@ -26,22 +26,22 @@ jobs:
runs-on: [self-hosted, X64]

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
# - uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
# - uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test

# test-linux-aarch64:
# runs-on: [self-hosted, arm]

# steps:
# - uses: actions/checkout@v3
# - uses: dtolnay/rust-toolchain@nightly
# - uses: dtolnay/rust-toolchain@stable
# with:
# components: rustfmt, clippy
# # - uses: Swatinem/rust-cache@v1
Expand All @@ -54,29 +54,29 @@ jobs:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test

test-windows:
runs-on: windows-latest

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test

lint:
runs-on: [self-hosted, X64]
Expand All @@ -87,14 +87,14 @@ jobs:
- nightly

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
# - uses: Swatinem/rust-cache@v1
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Format check
run: |
cargo fmt -- --check
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
# - uses: Swatinem/rust-cache@v1
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Format check
run: |
cargo fmt -- --check
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pilota-build/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pilota-build"
version = "0.11.27"
version = "0.11.28"
edition = "2021"
description = "Compile thrift and protobuf idl into rust code at compile-time."
documentation = "https://docs.rs/pilota-build"
Expand Down
16 changes: 8 additions & 8 deletions pilota-build/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -378,10 +378,10 @@ where
cx.exec_plugin(AutoDerivePlugin::new(
Arc::from(["#[derive(PartialOrd)]".into()]),
|ty| {
let ty = match &ty.kind {
ty::Vec(ty) => ty,
_ => ty,
};
let mut ty = ty;
while let ty::Vec(_ty) = &ty.kind {
ty = _ty;
}
if matches!(ty.kind, ty::Map(_, _) | ty::Set(_)) {
PredicateResult::No
} else {
Expand All @@ -393,10 +393,10 @@ where
cx.exec_plugin(AutoDerivePlugin::new(
Arc::from(["#[derive(Hash, Eq, Ord)]".into()]),
|ty| {
let ty = match &ty.kind {
ty::Vec(ty) => ty,
_ => ty,
};
let mut ty = ty;
while let ty::Vec(_ty) = &ty.kind {
ty = _ty;
}
if matches!(ty.kind, ty::Map(_, _) | ty::Set(_) | ty::F64 | ty::F32) {
PredicateResult::No
} else {
Expand Down
7 changes: 1 addition & 6 deletions pilota-build/src/middle/context.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
use std::{
collections::{HashMap, HashSet},
ops::Deref,
path::PathBuf,
sync::Arc,
};
use std::{collections::HashMap, ops::Deref, path::PathBuf, sync::Arc};

use anyhow::Context as _;
use dashmap::DashMap;
Expand Down
Loading
Loading