Skip to content

Commit

Permalink
Add impls for i128 and u128.
Browse files Browse the repository at this point in the history
  • Loading branch information
BriocheBerlin committed Nov 27, 2020
1 parent 4a1038c commit 707a520
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,16 @@ impl Format for i64 {
}
}

impl Format for i128 {
fn format(&self, fmt: &mut Formatter) {
if fmt.needs_tag() {
let t = internp!("{:i128}");
fmt.u8(&t);
}
fmt.i128(self);
}
}

impl Format for isize {
fn format(&self, fmt: &mut Formatter) {
if fmt.needs_tag() {
Expand Down Expand Up @@ -94,6 +104,16 @@ impl Format for u64 {
}
}

impl Format for u128 {
fn format(&self, fmt: &mut Formatter) {
if fmt.needs_tag() {
let t = internp!("{:u128}");
fmt.u8(&t);
}
fmt.u128(self);
}
}

impl Format for usize {
fn format(&self, fmt: &mut Formatter) {
if fmt.needs_tag() {
Expand Down

0 comments on commit 707a520

Please sign in to comment.