types: better debug impl for BoundedAddress
This commit is contained in:
parent
3d372d811a
commit
bf3ed7ff24
|
@ -5,9 +5,15 @@ use std::{
|
|||
|
||||
use crate::error::AddressError;
|
||||
|
||||
#[derive(Copy, Clone, Debug)]
|
||||
#[derive(Copy, Clone)]
|
||||
pub(crate) struct BoundedAddress<const MIN: u16, const MAX: u16>(u16);
|
||||
|
||||
impl<const MIN: u16, const MAX: u16> std::fmt::Debug for BoundedAddress<MIN, MAX> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
write!(f, "{:#04X}", self.0)
|
||||
}
|
||||
}
|
||||
|
||||
impl<const MIN: u16, const MAX: u16> Display for BoundedAddress<MIN, MAX> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
Display::fmt(&self.0, f)
|
||||
|
|
Loading…
Reference in a new issue