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

Remove redundant Pod and Zeroable derives for zero_copy structs #259

Merged
merged 1 commit into from
Apr 29, 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 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
Loading