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

feat: add trait partial ord #20

Merged
merged 5 commits into from
Mar 1, 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
2 changes: 1 addition & 1 deletion crates/cairo-serde/src/types/array_legacy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
use crate::{CairoSerde, Error, Result};
use starknet::core::types::FieldElement;

#[derive(Debug, Clone, PartialEq)]
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub struct CairoArrayLegacy<T>(pub Vec<T>);

impl<T: std::clone::Clone> CairoArrayLegacy<T> {
Expand Down
4 changes: 2 additions & 2 deletions crates/cairo-serde/src/types/starknet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use crate::{CairoSerde, Error, Result};
use starknet::core::types::FieldElement;

/// ContractAddress.
#[derive(Debug, Copy, Clone, PartialEq)]
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)]
pub struct ContractAddress(pub FieldElement);

impl From<FieldElement> for ContractAddress {
Expand Down Expand Up @@ -42,7 +42,7 @@ impl CairoSerde for ContractAddress {
}

/// ClassHash.
#[derive(Debug, Copy, Clone, PartialEq)]
#[derive(Debug, Copy, Clone, PartialEq, PartialOrd)]
pub struct ClassHash(pub FieldElement);

impl From<FieldElement> for ClassHash {
Expand Down
4 changes: 2 additions & 2 deletions crates/rs/src/expand/enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ impl CairoEnum {
// Those phantom fields are ignored by serde.

quote! {
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, PartialOrd, Clone)]
pub enum #enum_name<#(#gen_args),*> {
#(#variants),*
}
}
} else {
quote! {
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, PartialOrd, Clone)]
pub enum #enum_name {
#(#variants),*
}
Expand Down
4 changes: 2 additions & 2 deletions crates/rs/src/expand/struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ impl CairoStruct {
// Those phantom fields are ignored by serde.

quote! {
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, PartialOrd, Clone)]
pub struct #struct_name<#(#gen_args),*> {
#(pub #members),*
}
}
} else {
quote! {
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, PartialEq, PartialOrd, Clone)]
pub struct #struct_name {
#(pub #members),*
}
Expand Down
Loading