Merge pull request #1 from GuillaumeGomez/doc-comment

Add doc-comment to test README's examples
This commit is contained in:
Stjepan Glavina 2020-08-13 20:58:13 +02:00 committed by GitHub
commit eb1f0872ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -25,7 +25,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;