Browse Source

docs(question_mark): correct grammar

pull/1101/head
davhojt 2 years ago committed by Dav Hojt
parent
commit
baa94c3333
  1. 25
      subjects/question_mark/README.md

25
subjects/question_mark/README.md

@ -2,23 +2,14 @@
### Instructions ### Instructions
3 structure have to be created: Create the following structures. Each has one element:
- `One`: - `One`: `first_layer` as type `Option<Two>`.
- which contains one element called `first_layer` which should be an `Option` of the structure `Two`. - `Two`: `second_layer` as type `Option<Three>`
- `Two`: - `Three`: `third_layer` as type `Option<Four>`
- which contains one element called `second_layer` which should be an `Option` of the structure `Three`. - `Four`: `fourth_layer` as type `Option<u16>`.
- `Three`:
- which contains one element called `third_layer` which should be an `Option` of the structure `Four`.
- `Four`:
- which contains one element called `fourth_layer` which is an `Option<u16>`.
Beside the structure you must create a **function** named `get_fourth_layer` which is associated to the `One` structure (a method). Beside the structures, you must create a **function** named `get_fourth_layer`, and associate it to the `One` structure. This **function** should return the `Option` value in the `Four` structure.
This **function** should return the `Option` value in the `Four` structure.
### Notions
- [Unpacking options with ?](https://doc.rust-lang.org/stable/rust-by-example/error/option_unwrap/question_mark.html)
### Expected Function and structures ### Expected Function and structures
@ -74,3 +65,7 @@ $ cargo run
1000 1000
$ $
``` ```
### Notions
- [Unpacking options with ?](https://doc.rust-lang.org/stable/rust-by-example/error/option_unwrap/question_mark.html)

Loading…
Cancel
Save