docs(how_many_references) correct grammar

This commit is contained in:
davhojt 2022-06-03 15:08:17 +03:00 committed by Dav Hojt
parent 6db1756201
commit b3589b813d
1 changed files with 9 additions and 10 deletions

View File

@ -2,17 +2,11 @@
### Instructions
Create the following **functions** :
Create the following **functions**:
- `add_ele` which adds an element to the value in the `Node`
- `how_many_references` which returns how many times the value is referenced in the code
- `rm_all_ref` which receives a `Rc<String>` and removes all elements from the vector that
are equal to that value, this should only happen if the two Rcs point to the same allocation
### Notions
- [Reference Counted Smart Pointer](https://doc.rust-lang.org/book/ch15-04-rc.html)
- [Struct std::rc::Rc](https://doc.rust-lang.org/std/rc/struct.Rc.html)
- `add_ele`: which adds an element to the value in the `Node`.
- `how_many_references`: which returns how many times the value is referenced in the code.
- `rm_all_ref`: which accepts an `Rc<String>` and removes all elements from the vector that are equal to that value. This should only happen if the two `Rc`s point to the same allocation.
### Expected Functions and structures
@ -78,3 +72,8 @@ b: 2
c: 2
$
```
### Notions
- [Reference Counted Smart Pointer](https://doc.rust-lang.org/book/ch15-04-rc.html)
- [Struct std::rc::Rc](https://doc.rust-lang.org/std/rc/struct.Rc.html)