mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-11 16:31:07 +00:00
Make Slot and SlotDuration transparent (#2999)
I have a use case that for safety requires all contained data structures to be `#[repr(C)]` or `#[repr(transparent)]` and it seemed like non-invasive change.
This commit is contained in:
@@ -26,6 +26,7 @@ use sp_timestamp::Timestamp;
|
||||
/// Unit type wrapper that represents a slot.
|
||||
#[derive(Debug, Encode, MaxEncodedLen, Decode, Eq, Clone, Copy, Default, Ord, Hash, TypeInfo)]
|
||||
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
|
||||
#[repr(transparent)]
|
||||
pub struct Slot(u64);
|
||||
|
||||
impl core::ops::Deref for Slot {
|
||||
@@ -135,6 +136,7 @@ impl From<Slot> for u64 {
|
||||
Eq,
|
||||
TypeInfo,
|
||||
)]
|
||||
#[repr(transparent)]
|
||||
pub struct SlotDuration(u64);
|
||||
|
||||
impl SlotDuration {
|
||||
|
||||
Reference in New Issue
Block a user