From 70ade03348adf8e983ee3e387b916fe6e5a58ff8 Mon Sep 17 00:00:00 2001 From: sweet2honey <494632472@qq.com> Date: Tue, 19 Apr 2022 23:05:59 +0800 Subject: [PATCH] squashed: match alphanumeric; fix array typo. --- solutions/pattern-match/match.md | 2 +- zh-CN/src/compound-types/array.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/solutions/pattern-match/match.md b/solutions/pattern-match/match.md index 148da4e..55e2df3 100644 --- a/solutions/pattern-match/match.md +++ b/solutions/pattern-match/match.md @@ -80,7 +80,7 @@ fn main() { // fill the blank with `matches!` to make the code work for ab in alphabets { - assert!(matches!(ab, 'a'..='z' | 'A'..='Z' | '0' | '9')) + assert!(matches!(ab, 'a'..='z' | 'A'..='Z' | '0'..='9')) } } ``` diff --git a/zh-CN/src/compound-types/array.md b/zh-CN/src/compound-types/array.md index afd9413..96ab06f 100644 --- a/zh-CN/src/compound-types/array.md +++ b/zh-CN/src/compound-types/array.md @@ -1,5 +1,5 @@ # 数组 -数组的类型是 `[T; Lengh]`, 就如你所看到的,数组的长度是类型签名的一部分,因此数组的长度必须在编译期就已知,例如你不能使用以下方式来声明一个数组: +数组的类型是 `[T; Length]`,就如你所看到的,数组的长度是类型签名的一部分,因此数组的长度必须在编译期就已知,例如你不能使用以下方式来声明一个数组: ```rust fn create_arr(n: i32) { let arr = [1; n];