mirror of
https://github.com/gnu4cn/rust-lang-zh_CN.git
synced 2025-03-14 03:10:44 +08:00
Update Ch10
This commit is contained in:
parent
07b8cb8c18
commit
a3657db93a
@ -249,7 +249,7 @@ error: could not compile `generics_demo` due to previous error
|
||||
|
||||
### 在结构体定义中
|
||||
|
||||
这里还可以将结构体,定义为在其一个或多个字段中,运用 `<>` 语法来使用泛型参数。清单 10-6 定义了一个 `Point<T>` 的结构体,来保存任意类型的 `x` 与 `y` 坐标值。
|
||||
咱们也可使用这种 `<>` 语法,将结构体定义为在其一个或多个字段中使用泛型参数。清单 10-6 定义了一个 `Point<T>` 的结构体,来保存任意类型的 `x` 与 `y` 坐标值。
|
||||
|
||||
文件名:`src/main.rs`
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user