coreboot_fs/big_endian.rs
1use core::fmt;
2
3#[derive(Clone, Copy)]
4#[repr(transparent)]
5pub struct Be32(u32);
6
7impl From<Be32> for u32 {
8 fn from(be: Be32) -> Self {
9 u32::from_be(be.0)
10 }
11}
12
13impl fmt::Debug for Be32 {
14 #[inline]
15 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
16 u32::from(*self).fmt(f)
17 }
18}