Skip to content

Commit

Permalink
fix(pilota-build): don't derive eq for nested list double
Browse files Browse the repository at this point in the history
  • Loading branch information
Millione committed Dec 11, 2024
1 parent f6859a9 commit 8d4e95f
Show file tree
Hide file tree
Showing 6 changed files with 1,041 additions and 839 deletions.
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

0 comments on commit 8d4e95f

Please sign in to comment.