We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 966eaf6 commit 4bc4e26Copy full SHA for 4bc4e26
1 file changed
exercises/lifetimes/lifetimes1.rs
@@ -1,14 +1,4 @@
1
-// lifetimes1.rs
2
-// The Rust compiler needs to know how to check whether supplied references are
3
-// valid, so that it can let the programmer know if a reference is at risk of
4
-// going out of scope before it is used. Remember, references are borrows and do
5
-// not own their own data. What if their owner goes out of scope?
6
-// Execute `rustlings hint lifetimes1` or use the `hint` watch subcommand for a
7
-// hint.
8
9
-// I AM NOT DONE
10
-
11
-// 补充生命周期标注:返回引用的生命周期与入参x/y的生命周期相同('a)
12
fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
13
if x.len() > y.len() {
14
x
0 commit comments