add zh/generics.md

This commit is contained in:
sunface
2022-03-04 11:00:35 +08:00
parent f359056cac
commit fe6d0b4183
4 changed files with 153 additions and 5 deletions

View File

@ -34,7 +34,7 @@ fn main() {
2. 🌟🌟 A function call with explicitly specified type parameters looks like: `fun::<A, B, ...>()`.
```rust,editable
// implement a generic function
// implement the generic function below
fn sum
fn main() {
@ -124,7 +124,7 @@ fn main() {
7. 🌟🌟
```rust,editable
// make the code work
// fix the errors to make the code work
struct Point<T> {
x: T,
y: T,