1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-06-16 14:17:34 +02:00

Fix Rustdoc.

This commit is contained in:
Andrew Walbran
2023-01-17 12:33:50 +00:00
parent 13da3112e9
commit 8f6dcf35f5

View File

@ -3,7 +3,7 @@
Rust has built-in support for documentation tests:
```rust
/// Shorten string will trip the string to the given length.
/// Shortens a string to the given length.
///
/// ```
/// use playground::shorten_string;
@ -17,4 +17,4 @@ pub fn shorten_string(s: &str, length: usize) -> &str {
* Code blocks in `///` comments are automatically seen as Rust code.
* The code will be compiled and executed as part of `cargo test`.
* Test the above code on the [Rust Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=c8ce535a3778218fed50c2b4c317d15d).
* Test the above code on the [Rust Playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=3ce2ad13ea1302f6572cb15cd96becf0).