Compare commits
1 Commits
main
...
small-upda
Author | SHA1 | Date | |
---|---|---|---|
d5172489cc |
10
CHANGELOG.md
10
CHANGELOG.md
@ -8,6 +8,16 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
|
|
||||||
# [unreleased]
|
# [unreleased]
|
||||||
|
|
||||||
|
# [v0.12.0] 2024-06-06
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- `Default` impl for `GenericUnsignedByteField<()>` (also called `UnsignedByteFieldEmpty`)
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- Removed `Into<u64>` type constraint for `GenericUnsignedByteField`
|
||||||
|
|
||||||
# [v0.11.2] 2024-05-19
|
# [v0.11.2] 2024-05-19
|
||||||
|
|
||||||
- Bumped MSRV to 1.68.2
|
- Bumped MSRV to 1.68.2
|
||||||
|
10
src/util.rs
10
src/util.rs
@ -242,7 +242,7 @@ impl UnsignedEnum for UnsignedByteField {
|
|||||||
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
#[derive(Debug, Copy, Clone, Eq, PartialEq)]
|
||||||
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
|
||||||
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
|
||||||
pub struct GenericUnsignedByteField<TYPE: Copy + Into<u64>> {
|
pub struct GenericUnsignedByteField<TYPE: Copy> {
|
||||||
value: TYPE,
|
value: TYPE,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -290,6 +290,14 @@ pub type UbfU16 = UnsignedByteFieldU16;
|
|||||||
pub type UbfU32 = UnsignedByteFieldU32;
|
pub type UbfU32 = UnsignedByteFieldU32;
|
||||||
pub type UbfU64 = UnsignedByteFieldU64;
|
pub type UbfU64 = UnsignedByteFieldU64;
|
||||||
|
|
||||||
|
impl Default for GenericUnsignedByteField<()> {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
value: Default::default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl From<UnsignedByteFieldU8> for UnsignedByteField {
|
impl From<UnsignedByteFieldU8> for UnsignedByteField {
|
||||||
fn from(value: UnsignedByteFieldU8) -> Self {
|
fn from(value: UnsignedByteFieldU8) -> Self {
|
||||||
Self::new(1, value.value as u64)
|
Self::new(1, value.value as u64)
|
||||||
|
Loading…
Reference in New Issue
Block a user