Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mask before rendering in various display traits #59

Merged
merged 1 commit into from
Mar 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,31 +191,31 @@ macro_rules! implement_common {
// Implement formating functions
impl Display for $name {
fn fmt(&self, f: &mut Formatter) -> Result<(), lib::core::fmt::Error> {
let &$name(ref value) = self;
let $name(ref value) = self.mask();
<$type as Display>::fmt(value, f)
}
}
impl UpperHex for $name {
fn fmt(&self, f: &mut Formatter) -> Result<(), lib::core::fmt::Error> {
let &$name(ref value) = self;
let $name(ref value) = self.mask();
<$type as UpperHex>::fmt(value, f)
}
}
impl LowerHex for $name {
fn fmt(&self, f: &mut Formatter) -> Result<(), lib::core::fmt::Error> {
let &$name(ref value) = self;
let $name(ref value) = self.mask();
<$type as LowerHex>::fmt(value, f)
}
}
impl Octal for $name {
fn fmt(&self, f: &mut Formatter) -> Result<(), lib::core::fmt::Error> {
let &$name(ref value) = self;
let $name(ref value) = self.mask();
<$type as Octal>::fmt(value, f)
}
}
impl Binary for $name {
fn fmt(&self, f: &mut Formatter) -> Result<(), lib::core::fmt::Error> {
let &$name(ref value) = self;
let $name(ref value) = self.mask();
<$type as Binary>::fmt(value, f)
}
}
Expand Down