From c7b5cdf8ba170880cae6da7bc50018408f366900 Mon Sep 17 00:00:00 2001 From: Allan Downey Date: Sat, 26 Mar 2022 20:58:48 +0800 Subject: [PATCH] update(index-list): add tuple --- src/index-list.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index-list.md b/src/index-list.md index 52447f3f..9cf2528b 100644 --- a/src/index-list.md +++ b/src/index-list.md @@ -241,9 +241,12 @@ ## T -| 名称 | 关键字 | 简介 | -| ---- | ------ | ------------- | -| T | KWT | TIntroduction | +| 名称 | 关键字 | 简介 | +| ------------ | ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| [Tuple 元组] | | 由多种类型组合一起,元组的长度是固定的,元组中元素的顺序也是固定的
用模式匹配解构元组: `let (x, y, z) = (20, 19.2, 1)`
用 `.` 来访问元组: `tuple.0` 索引从 0 开始 | +| T | KWT | TIntroduction | + +[tuple 元组]: https://course.rs/basic/compound-type/tuple.html#元组 [back](#head)