diff options
| author | Oliver Middleton <olliemail27@gmail.com> | 2016-06-09 23:03:14 +0100 |
|---|---|---|
| committer | Oliver Middleton <olliemail27@gmail.com> | 2016-06-09 23:03:14 +0100 |
| commit | ee469058e1676bcf5d36c8754aa48f83733f9bdb (patch) | |
| tree | 6ed7a912e8aea4fc67a9aed4d80ab96eb651f331 /src/libcore/num | |
| parent | 0740a93cc290a5419807d2e8c6c442354baf46b0 (diff) | |
| download | rust-ee469058e1676bcf5d36c8754aa48f83733f9bdb.tar.gz rust-ee469058e1676bcf5d36c8754aa48f83733f9bdb.zip | |
Implement Binary, Octal, LowerHex and UpperHex for Wrapping<T>
Diffstat (limited to 'src/libcore/num')
| -rw-r--r-- | src/libcore/num/mod.rs | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 883e9206dde..06398fc094e 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -66,6 +66,34 @@ impl<T: fmt::Display> fmt::Display for Wrapping<T> { } } +#[stable(feature = "wrapping_fmt", since = "1.11.0")] +impl<T: fmt::Binary> fmt::Binary for Wrapping<T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + +#[stable(feature = "wrapping_fmt", since = "1.11.0")] +impl<T: fmt::Octal> fmt::Octal for Wrapping<T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + +#[stable(feature = "wrapping_fmt", since = "1.11.0")] +impl<T: fmt::LowerHex> fmt::LowerHex for Wrapping<T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + +#[stable(feature = "wrapping_fmt", since = "1.11.0")] +impl<T: fmt::UpperHex> fmt::UpperHex for Wrapping<T> { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + self.0.fmt(f) + } +} + mod wrapping; // All these modules are technically private and only exposed for libcoretest: |
