This commit is contained in:
parent
d9bec9da08
commit
433cdaae46
@ -1,3 +1,5 @@
|
|||||||
|
# `bind`
|
||||||
|
|
||||||
Make this compile and pass tests:
|
Make this compile and pass tests:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
@ -29,6 +31,7 @@ assert_eq!(
|
|||||||
```
|
```
|
||||||
|
|
||||||
Try solving it in the playground:
|
Try solving it in the playground:
|
||||||
|
|
||||||
```rust,editable,compile_fail
|
```rust,editable,compile_fail
|
||||||
fn bind<T, F: Fn(T) -> Option<T>>(f: F, fa: Option<T>) -> Option<T> {
|
fn bind<T, F: Fn(T) -> Option<T>>(f: F, fa: Option<T>) -> Option<T> {
|
||||||
match fa {
|
match fa {
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
# `bind`, but with references
|
||||||
|
|
||||||
Make this compile and pass tests:
|
Make this compile and pass tests:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
|
Loading…
Reference in New Issue
Block a user