mirror of
https://gitlab.com/veilid/veilid.git
synced 2025-02-02 09:35:34 -05:00
Merge branch 'from-into-u8-array-types' into 'main'
impl from and into [u8; size] for byte array types See merge request veilid/veilid!256
This commit is contained in:
commit
fedc4d7bb5
@ -261,6 +261,18 @@ macro_rules! byte_array_type {
|
||||
&mut self.bytes
|
||||
}
|
||||
}
|
||||
|
||||
impl From<[u8; $size]> for $name {
|
||||
fn from(value: [u8; $size]) -> Self {
|
||||
Self::new(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<$name> for [u8; $size] {
|
||||
fn from(value: $name) -> Self {
|
||||
value.bytes
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user