From cb0e119bedeb965ff85170bae5b62dae5162d77f Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Thu, 24 Oct 2024 08:57:43 +0000 Subject: [PATCH] rust/pv_core: Add `From` and `From Reviewed-by: Steffen Eiden Signed-off-by: Steffen Eiden --- rust/pv_core/src/utils.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rust/pv_core/src/utils.rs b/rust/pv_core/src/utils.rs index 27f7625f..3366124d 100644 --- a/rust/pv_core/src/utils.rs +++ b/rust/pv_core/src/utils.rs @@ -72,6 +72,12 @@ impl From<&u64> for Msb0Flags64 { } } +impl From for u64 { + fn from(value: Msb0Flags64) -> Self { + value.0.into() + } +} + /// Bitflags in LSB0 ordering /// /// Wraps an u64 to set/get individual bits @@ -114,6 +120,12 @@ impl From<&u64> for Lsb0Flags64 { } } +impl From for u64 { + fn from(value: Lsb0Flags64) -> Self { + value.0.into() + } +} + /// Tries to convert a BE hex string into a 128 unsigned integer /// The hexstring must contain 32chars of hexdigits ///