Skip to content

Commit 4bc4e26

Browse files
authored
Update lifetimes1.rs
1 parent 966eaf6 commit 4bc4e26

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

exercises/lifetimes/lifetimes1.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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.
81

9-
// I AM NOT DONE
10-
11-
// 补充生命周期标注:返回引用的生命周期与入参x/y的生命周期相同('a)
122
fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {
133
if x.len() > y.len() {
144
x

0 commit comments

Comments
 (0)