Skip to content

Commit f72c91d

Browse files
bors[bot]eldruin
andauthored
Merge #221
221: Enable doctests and fix them r=therealprof a=eldruin I discovered that due to a typo some doctests were not being run. A couple small fixes were also necessary for them to compile. Co-authored-by: Diego Barrios Romero <[email protected]>
2 parents e626c84 + ed7de7a commit f72c91d

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/lib.rs

+8-7
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@
237237
//! must provide the `libstd` in order to be able to use `futures`, which is not
238238
//! the case for many embedded targets.
239239
//!
240-
//! ```not_run
240+
//! ```no_run
241241
//! extern crate embedded_hal as hal;
242242
//! extern crate futures;
243243
//!
@@ -257,7 +257,7 @@
257257
//! /// `futures` version of `CountDown.try_wait`
258258
//! ///
259259
//! /// This returns a future that must be polled to completion
260-
//! fn wait<T>(mut timer: T) -> impl Future<Item = T, Error = Infallible>
260+
//! fn wait<T>(mut timer: T) -> impl Future<Item = T, Error = T::Error>
261261
//! where
262262
//! T: hal::timer::CountDown,
263263
//! {
@@ -349,9 +349,10 @@
349349
//! # use core::convert::Infallible;
350350
//! # pub struct Timer6;
351351
//! # impl ::hal::timer::CountDown for Timer6 {
352+
//! # type Error = Infallible;
352353
//! # type Time = ();
353354
//! #
354-
//! # fn try_start<T>(&mut self, _: T) -> Result<(), Infallible> where T: Into<()> {}
355+
//! # fn try_start<T>(&mut self, _: T) -> Result<(), Infallible> where T: Into<()> { Ok(()) }
355356
//! # fn try_wait(&mut self) -> ::nb::Result<(), Infallible> { Err(::nb::Error::WouldBlock) }
356357
//! # }
357358
//! #
@@ -380,7 +381,7 @@
380381
//! (same remark concerning the availability of `libstd` on the
381382
//! target).
382383
//!
383-
//! ```not_run
384+
//! ```no_run
384385
//! #![feature(generator_trait)]
385386
//! #![feature(generators)]
386387
//!
@@ -437,8 +438,8 @@
437438
//!
438439
//! // Event loop
439440
//! loop {
440-
//! Pin::new(&mut blinky).resume();
441-
//! Pin::new(&mut loopback).resume();
441+
//! Pin::new(&mut blinky).resume(());
442+
//! Pin::new(&mut loopback).resume(());
442443
//! # break;
443444
//! }
444445
//! }
@@ -553,7 +554,7 @@
553554
//!
554555
//! - Asynchronous SPI transfer
555556
//!
556-
//! ```not_run
557+
//! ```no_run
557558
//! #![feature(conservative_impl_trait)]
558559
//! #![feature(generators)]
559560
//! #![feature(generator_trait)]

0 commit comments

Comments
 (0)