mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-03-23 07:06:19 +02:00
Add notes about traits.
This commit is contained in:
parent
bc21369dcb
commit
d6027f5080
@ -1,5 +1,13 @@
|
||||
# More traits
|
||||
|
||||
We derived the `Debug` trait. It would be useful to implement a few more traits too.
|
||||
|
||||
```rust,editable,compile_fail
|
||||
{{#include ../examples/src/pl011_minimal.rs:Traits}}
|
||||
```
|
||||
|
||||
<details>
|
||||
|
||||
* Implementing `Write` lets us use the `write!` and `writeln!` macros with our `Uart` type.
|
||||
|
||||
</details>
|
||||
|
Loading…
x
Reference in New Issue
Block a user