diff --git a/src/capture.rs b/src/capture.rs index 136e7c727..5a51a09a6 100644 --- a/src/capture.rs +++ b/src/capture.rs @@ -47,7 +47,7 @@ pub mod nb { /// # fn disable(&mut self, _: Channel) -> Result<(), Self::Error> { unimplemented!() } /// # fn enable(&mut self, _: Channel) -> Result<(), Self::Error> { unimplemented!() } /// # fn get_resolution(&self) -> Result { unimplemented!() } - /// # fn set_resolution(&mut self, _: T) -> Result<(), Self::Error> where T: Into { Ok(()) } + /// # fn set_resolution(&mut self, _: MilliSeconds) -> Result<(), Self::Error> { Ok(()) } /// # } /// ``` // unproven reason: pre-singletons API. With singletons a `CapturePin` (cf. `PwmPin`) trait seems more @@ -90,9 +90,7 @@ pub mod nb { fn get_resolution(&self) -> Result; /// Sets the resolution of the capture timer - fn set_resolution(&mut self, resolution: R) -> Result<(), Self::Error> - where - R: Into; + fn set_resolution(&mut self, resolution: Self::Time) -> Result<(), Self::Error>; } impl Capture for &mut T { @@ -120,10 +118,7 @@ pub mod nb { T::get_resolution(self) } - fn set_resolution(&mut self, resolution: R) -> Result<(), Self::Error> - where - R: Into, - { + fn set_resolution(&mut self, resolution: Self::Time) -> Result<(), Self::Error> { T::set_resolution(self, resolution) } } diff --git a/src/pwm.rs b/src/pwm.rs index 1208fc0f3..6f5f110e1 100644 --- a/src/pwm.rs +++ b/src/pwm.rs @@ -47,7 +47,7 @@ pub mod blocking { /// # fn get_max_duty(&self) -> Result { Ok(0) } /// # fn set_duty(&mut self, _: &Channel, _: u16) -> Result<(), Self::Error> { Ok(()) } /// # fn get_period(&self) -> Result { unimplemented!() } - /// # fn set_period(&mut self, _: T) -> Result<(), Self::Error> where T: Into { Ok(()) } + /// # fn set_period(&mut self, _: KiloHertz) -> Result<(), Self::Error> { Ok(()) } /// # } /// ``` // unproven reason: pre-singletons API. The `PwmPin` trait seems more useful because it models independent @@ -97,9 +97,7 @@ pub mod blocking { ) -> Result<(), Self::Error>; /// Sets a new PWM period - fn set_period

(&mut self, period: P) -> Result<(), Self::Error> - where - P: Into; + fn set_period(&mut self, period: Self::Time) -> Result<(), Self::Error>; } impl Pwm for &mut T { @@ -139,10 +137,7 @@ pub mod blocking { T::set_duty(self, channel, duty) } - fn set_period

(&mut self, period: P) -> Result<(), Self::Error> - where - P: Into, - { + fn set_period(&mut self, period: Self::Time) -> Result<(), Self::Error> { T::set_period(self, period) } } diff --git a/src/qei.rs b/src/qei.rs index 688e86f99..72a880641 100644 --- a/src/qei.rs +++ b/src/qei.rs @@ -62,7 +62,7 @@ pub mod blocking { /// # impl hal::timer::nb::CountDown for Timer6 { /// # type Error = Infallible; /// # type Time = Seconds; - /// # fn start(&mut self, _: T) -> Result<(), Infallible> where T: Into { Ok(()) } + /// # fn start(&mut self, _: Seconds) -> Result<(), Infallible> { Ok(()) } /// # fn wait(&mut self) -> ::nb::Result<(), Infallible> { Ok(()) } /// # } /// ``` diff --git a/src/timer.rs b/src/timer.rs index 83ba65614..c35544e28 100644 --- a/src/timer.rs +++ b/src/timer.rs @@ -56,7 +56,7 @@ pub mod nb { /// # impl hal::timer::nb::CountDown for Timer6 { /// # type Error = Infallible; /// # type Time = Seconds; - /// # fn start(&mut self, _: T) -> Result<(), Self::Error> where T: Into { Ok(()) } + /// # fn start(&mut self, _: Seconds) -> Result<(), Self::Error> { Ok(()) } /// # fn wait(&mut self) -> ::nb::Result<(), Infallible> { Ok(()) } /// # } /// ``` @@ -70,9 +70,7 @@ pub mod nb { type Time; /// Starts a new count down - fn start(&mut self, count: T) -> Result<(), Self::Error> - where - T: Into; + fn start(&mut self, count: Self::Time) -> Result<(), Self::Error>; /// Non-blockingly "waits" until the count down finishes /// @@ -90,10 +88,7 @@ pub mod nb { type Time = T::Time; - fn start