diff --git a/README.md b/README.md index b45d4e195b24c78e32735e5676d1c3067756d80d..4c36aab6dffae6d949b3da7bb0706a9724c0303e 100644 --- a/README.md +++ b/README.md @@ -7,10 +7,6 @@ Adds debug to volatile register when compiled with `--features debug-fmt`. -## Caveats - -Notice, the current implementation requres a nightly toolchain (`feature(specilization`)). -This can be ``` rust extern crate volatile_register; diff --git a/examples/example.rs b/examples/example.rs index 411c6463cab05a6efe0f6511bbb929d3587f6846..dd87d7fbcac582cc689265090e3664111623b450 100644 --- a/examples/example.rs +++ b/examples/example.rs @@ -1,4 +1,4 @@ -//! Example to show the use of debug output for small register arrays +//! Example to show the use of `Debug` formatting for small register arrays //! //! > cargo run --example example2 --features debug-fmt //! diff --git a/examples/example2.rs b/examples/example2.rs index 1970e6a14f5dea21db65cb716fa8d89ae26469ab..805e28fb489a4614e526fb223fbaf19ebd4b5057 100644 --- a/examples/example2.rs +++ b/examples/example2.rs @@ -1,4 +1,4 @@ -//! Example to show the use of debug output for big register arrays +//! Example to show the use of ¡Debug` formatting for big register arrays //! //! > cargo run --example example2 --features debug-fmt //! diff --git a/src/lib.rs b/src/lib.rs index 99522ceb3bd055fffec58b652baba436643eb01a..c9394d218d8a5852a8f3fb5373d07e9dfee7b431 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -27,13 +27,11 @@ #![deny(missing_docs)] #![no_std] -#![cfg_attr(feature = "debug-fmt", feature(specialization))] extern crate vcell; #[cfg(feature = "debug-fmt")] use core::fmt::{self, Debug, UpperHex}; -#[cfg(feature = "debug-fmt")] use vcell::VolatileCell; /// Read-Only register @@ -44,16 +42,6 @@ where register: VolatileCell<T>, } -#[cfg(feature = "debug-fmt")] -impl<T> fmt::Debug for RO<T> -where - T: Copy + Debug, -{ - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{:?}", self.read()) - } -} - #[cfg(feature = "debug-fmt")] impl<T> fmt::Debug for RO<T> where @@ -75,16 +63,6 @@ where } } -#[cfg(feature = "debug-fmt")] -impl<T> fmt::Debug for RW<T> -where - T: Copy + Debug, -{ - default fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{:?}", self.read()) - } -} - #[cfg(feature = "debug-fmt")] impl<T> fmt::Debug for RW<T> where