remove unnecessary lifetime tag

the lifetime tag of the longest function might be unnecessary and should be removed
pull/1090/head
贺兰星辰 3 years ago committed by GitHub
parent 2d17b02d5a
commit ac50cbe0aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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