Add doc-comment to test README's examples

This commit is contained in:
Guillaume Gomez 2020-08-06 16:12:52 +02:00
parent d763bb2d90
commit 8d77ab712f
3 changed files with 8 additions and 1 deletions

View File

@ -16,6 +16,9 @@ readme = "README.md"
cfg-if = "0.1.10"
libc = "0.2.74"
[dev-dependencies]
doc-comment = "0.3"
[target.'cfg(windows)'.dependencies]
# Patched version of wepoll that can be notified by PostQueuedCompletionStatus.
wepoll-sys-stjepang = "1.0.6"

View File

@ -24,7 +24,7 @@ Only one thread can be waiting for I/O events at a time.
## Examples
```rust
```rust,no_run
use polling::{Event, Poller};
use std::net::TcpListener;
@ -54,6 +54,7 @@ loop {
}
}
}
std::io::Result::Ok(())
```
## License

View File

@ -48,6 +48,9 @@
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
#[cfg(doctest)]
doc_comment::doctest!("../README.md");
use std::fmt;
use std::io;
use std::sync::Mutex;