forked from rust-lang/rustlings
-
Notifications
You must be signed in to change notification settings - Fork 1
/
part5.toml
30 lines (26 loc) · 932 Bytes
/
part5.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
[[exercises]]
name = "lifetimes1"
path = "exercises/16_lifetimes/lifetimes1.rs"
mode = "compile"
hint = """
Let the compiler guide you. Also take a look at the book if you need help:
https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html"""
[[exercises]]
name = "lifetimes2"
path = "exercises/16_lifetimes/lifetimes2.rs"
mode = "compile"
hint = """
Remember that the generic lifetime `'a` will get the concrete lifetime that is
equal to the smaller of the lifetimes of `x` and `y`.
You can take at least two paths to achieve the desired result while keeping the
inner block:
1. Move the `string2` declaration to make it live as long as `string1` (how is
`result` declared?)
2. Move `println!` into the inner block"""
[[exercises]]
name = "lifetimes3"
path = "exercises/16_lifetimes/lifetimes3.rs"
mode = "compile"
hint = """
If you use a lifetime annotation in a struct's fields, where else does it need
to be added?"""