mirror of https://github.com/smol-rs/polling
Add doc-comment to test README's examples
This commit is contained in:
parent
d763bb2d90
commit
8d77ab712f
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue