@@ -196,10 +196,10 @@ This will highlight according to whatever language you're showing off.
196
196
If you're just showing plain text, choose ` text ` .
197
197
198
198
It's important to choose the correct annotation here, because ` rustdoc ` uses it
199
- in an interesting way: It can be used to actually test your examples, so that
200
- they don't get out of date. If you have some C code but ` rustdoc ` thinks it's
201
- Rust because you left off the annotation, ` rustdoc ` will complain when trying to
202
- generate the documentation.
199
+ in an interesting way: It can be used to actually test your examples in a
200
+ library crate, so that they don't get out of date. If you have some C code but
201
+ ` rustdoc ` thinks it's Rust because you left off the annotation, ` rustdoc ` will
202
+ complain when trying to generate the documentation.
203
203
204
204
## Documentation as tests
205
205
@@ -377,8 +377,8 @@ $ rustdoc --test path/to/my/crate/root.rs
377
377
$ cargo test
378
378
```
379
379
380
- That's right, ` cargo test ` tests embedded documentation too. However,
381
- ` cargo test ` will not test binary crates, only library ones. This is
380
+ That's right, ` cargo test ` tests embedded documentation too. ** However,
381
+ ` cargo test ` will not test binary crates, only library ones.** This is
382
382
due to the way ` rustdoc ` works: it links against the library to be tested,
383
383
but with a binary, there’s nothing to link to.
384
384
0 commit comments