We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f1f764 commit 8eb56e6Copy full SHA for 8eb56e6
src/doc/book/lifetimes.md
@@ -335,11 +335,13 @@ fn print<'a>(s: &'a str); // expanded
335
336
fn debug(lvl: u32, s: &str); // elided
337
fn debug<'a>(lvl: u32, s: &'a str); // expanded
338
+```
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.
+In the preceding example, `lvl` doesn’t need a lifetime because it’s not a
+reference (`&`). Only things relating to references (such as a `struct`
342
+which contains a reference) need lifetimes.
343
344
+```rust,ignore
345
fn substr(s: &str, until: u32) -> &str; // elided
346
fn substr<'a>(s: &'a str, until: u32) -> &'a str; // expanded
347
0 commit comments