mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-23 20:49:41 +00:00
fix: make the exercise editable to run
This commit is contained in:
committed by
GitHub
parent
bce4f2116f
commit
ab71e9a549
@ -101,7 +101,7 @@ and could then be used to compare a `&'a T` with any lifetime to an `i32`.
|
||||
Only a higher-ranked bound can be used here, because the lifetime of the reference is shorter than any possible lifetime parameter on the function。
|
||||
|
||||
4、🌟🌟🌟
|
||||
```rust
|
||||
```rust,editable
|
||||
/* Adding HRTB to make it work!*/
|
||||
fn call_on_ref_zero<'a, F>(f: F) where F: Fn(&'a i32) {
|
||||
let zero = 0;
|
||||
@ -236,7 +236,7 @@ struct Ref<'a, T> {
|
||||
## A difficult exercise
|
||||
|
||||
6、🌟🌟🌟🌟
|
||||
```rust
|
||||
```rust,editable
|
||||
/* Make it work */
|
||||
struct Interface<'a> {
|
||||
manager: &'a mut Manager<'a>
|
||||
|
Reference in New Issue
Block a user