docs(exercises): updated all exercises readme files

all exercises readme files now have a unified structure and a description
This commit is contained in:
Zerotask
2021-04-23 19:54:31 +02:00
parent 54804e344d
commit 249ad44cc0
20 changed files with 85 additions and 54 deletions

View File

@@ -1,4 +1,4 @@
### Traits
# Traits
A trait is a collection of methods.
@@ -7,14 +7,13 @@ Data types can implement traits. To do so, the methods making up the trait are d
In this way, traits are somewhat similar to Java interfaces and C++ abstract classes.
Some additional common Rust traits include:
+ `Clone` (the `clone` method),
+ `Display` (which allows formatted display via `{}`), and
+ `Debug` (which allows formatted display via `{:?}`).
- `Clone` (the `clone` method)
- `Display` (which allows formatted display via `{}`)
- `Debug` (which allows formatted display via `{:?}`)
Because traits indicate shared behavior between data types, they are useful when writing generics.
#### Book Sections
## Further information
- [Traits](https://doc.rust-lang.org/book/ch10-02-traits.html)