Update lifetime.md

此处没有用到生命周期标注符,可以去掉了
pull/1501/head
张浩扬穿JK 2 months ago committed by GitHub
parent e3a9d18ef0
commit f1fb9a558f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -287,7 +287,7 @@ error[E0515]: cannot return value referencing local variable `result` // 返回
那遇到这种情况该怎么办?最好的办法就是返回内部字符串的所有权,然后把字符串的所有权转移给调用者: 那遇到这种情况该怎么办?最好的办法就是返回内部字符串的所有权,然后把字符串的所有权转移给调用者:
```rust ```rust
fn longest<'a>(_x: &str, _y: &str) -> String { fn longest(_x: &str, _y: &str) -> String {
String::from("really long string") String::from("really long string")
} }

Loading…
Cancel
Save