mirror of
https://github.com/sunface/rust-by-practice.git
synced 2025-06-24 13:09:40 +00:00
add zh/generics.md
This commit is contained in:
@ -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,
|
||||
|
Reference in New Issue
Block a user