mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 20:49:41 +00:00
add editable to problem 4 in zh-CN/src/lifetime/advance.md
This commit is contained in:
@ -101,7 +101,7 @@ impl<'a> PartialEq<i32> for &'a T {
|
|||||||
这里只能使用更高级别的约束,因为引用的生命周期比函数上任何可能的生命周期参数都短。
|
这里只能使用更高级别的约束,因为引用的生命周期比函数上任何可能的生命周期参数都短。
|
||||||
|
|
||||||
4. 🌟🌟🌟
|
4. 🌟🌟🌟
|
||||||
```rust
|
```rust,editable
|
||||||
/* 添加 HRTB 使下面代码正常运行! */
|
/* 添加 HRTB 使下面代码正常运行! */
|
||||||
fn call_on_ref_zero<'a, F>(f: F) where F: Fn(&'a i32) {
|
fn call_on_ref_zero<'a, F>(f: F) where F: Fn(&'a i32) {
|
||||||
let zero = 0;
|
let zero = 0;
|
||||||
|
Reference in New Issue
Block a user