Skip to content

Commit

Permalink
Remove redundant Pod and Zeroable derives for zero_copy structs
Browse files Browse the repository at this point in the history
They were causing errors with some rust versions.
  • Loading branch information
ckamm committed Apr 29, 2024
1 parent 8928d4c commit 26689e4
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion programs/openbook-v2/src/state/orderbook/heap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ impl EventNode {

const EVENT_SIZE: usize = 144;
#[zero_copy]
#[derive(Debug, bytemuck::Pod, bytemuck::Zeroable)]
#[derive(Debug)]
pub struct AnyEvent {
pub event_type: u8,
pub padding: [u8; 143],
Expand Down
1 change: 0 additions & 1 deletion programs/openbook-v2/src/state/orderbook/nodes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,6 @@ const_assert_eq!(size_of::<FreeNode>(), NODE_SIZE);
const_assert_eq!(size_of::<FreeNode>() % 8, 0);

#[zero_copy]
#[derive(bytemuck::Pod, bytemuck::Zeroable)]
pub struct AnyNode {
pub tag: u8,
pub data: [u8; 87],
Expand Down
2 changes: 0 additions & 2 deletions programs/openbook-v2/src/state/orderbook/ordertree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ impl OrderTreeType {
}

#[zero_copy]
#[derive(bytemuck::Pod, bytemuck::Zeroable)]
pub struct OrderTreeRoot {
pub maybe_node: NodeHandle,
pub leaf_count: u32,
Expand All @@ -58,7 +57,6 @@ impl OrderTreeRoot {
///
/// The key encodes the price in the top 64 bits.
#[zero_copy]
#[derive(bytemuck::Pod, bytemuck::Zeroable)]
pub struct OrderTreeNodes {
pub order_tree_type: u8, // OrderTreeType, but that's not POD
pub padding: [u8; 3],
Expand Down

0 comments on commit 26689e4

Please sign in to comment.