Skip to content

Commit 8eb56e6

Browse files
authored
took comment out of code block
no reason for a long comment in a code block when we could take it out, especially since it looks like it's using markdown (`struct`, `&` and `lvl`).
1 parent 4f1f764 commit 8eb56e6

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/doc/book/lifetimes.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -335,11 +335,13 @@ fn print<'a>(s: &'a str); // expanded
335335
336336
fn debug(lvl: u32, s: &str); // elided
337337
fn debug<'a>(lvl: u32, s: &'a str); // expanded
338+
```
338339

339-
// In the preceding example, `lvl` doesn’t need a lifetime because it’s not a
340-
// reference (`&`). Only things relating to references (such as a `struct`
341-
// which contains a reference) need lifetimes.
340+
In the preceding example, `lvl` doesn’t need a lifetime because it’s not a
341+
reference (`&`). Only things relating to references (such as a `struct`
342+
which contains a reference) need lifetimes.
342343

344+
```rust,ignore
343345
fn substr(s: &str, until: u32) -> &str; // elided
344346
fn substr<'a>(s: &'a str, until: u32) -> &'a str; // expanded
345347

0 commit comments

Comments
 (0)