Skip to content

Commit 8059a11

Browse files
the-ssdRalith
authored andcommitted
Add README to the doctest
1 parent ff51a60 commit 8059a11

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ your application however you like!
1212
### Example
1313

1414
```rust
15+
use hecs::*;
16+
1517
let mut world = World::new();
1618
// Nearly any type can be used as a component with zero boilerplate
1719
let a = world.spawn((123, true, "abc"));
@@ -100,8 +102,8 @@ If hecs doesn't suit you, one of those might do the trick!
100102

101103
Licensed under either of
102104

103-
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
104-
* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
105+
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
106+
* MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)
105107

106108
at your option.
107109

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@
3232
#[cfg(feature = "std")]
3333
extern crate std;
3434

35+
#[doc(hidden)]
36+
#[doc = include_str!("../README.md")]
37+
mod readme_doctest {}
38+
3539
#[doc(hidden)]
3640
pub extern crate alloc;
3741
#[doc(hidden)]

0 commit comments

Comments
 (0)