Browse Source

docs(box_recursion) correct grammar

1122-buz-zinga
davhojt 2 years ago committed by Dav Hojt
parent
commit
6db1756201
  1. 24
      subjects/box_recursion/README.md

24
subjects/box_recursion/README.md

@ -2,21 +2,14 @@
### Instructions
Using the given code create the following **functions**:
Using the given code, create the following **associated functions**:
- `new` which will initialize the `WorkEnvironment` as `None`
- `add_worker`, which receives two strings, one being the type of worker and the other the name of the worker.
- `remove_worker`, which removes the last worker that was placed in the `WorkEnvironment`, this function should
returns an `Option` with the name of the worker.
- `search_worker`, which returns a tuple with the name and type of worker.
- `new`: which will initialize the `WorkEnvironment` with `grade` set to `None`.
- `add_worker`: which receives two strings, one being the type of worker and the other the name of the worker.
- `remove_worker`: which removes the last worker that was placed in the `WorkEnvironment`, this function returns an `Option` with the name of the worker.
- `search_worker`: which returns a tuple with the name and type of worker.
You must also create a type called `Link`. This will be the connection of the structures `WorkEnvironment` and `Worker`.
Do not forget that this will be a recursion type and it must point to `None` if there is no workers.
### Notions
- [boc](https://doc.rust-lang.org/book/ch15-01-box.html)
- [Module std::option](https://doc.rust-lang.org/std/option/)
You must also create a type named `Link`. This will be the connection between the `WorkEnvironment` and `Worker` structures. This will be a recursion type, and it must point to `None` if there is no `Worker` to point to.
### Expected Functions and structures
@ -77,3 +70,8 @@ Some(("Alice", "Normal Worker"))
WorkEnvironment { grade: None }
$
```
### Notions
- [boc](https://doc.rust-lang.org/book/ch15-01-box.html)
- [Module std::option](https://doc.rust-lang.org/std/option/)

Loading…
Cancel
Save