diff --git a/codes/rust/chapter_array_and_linkedlist/array.rs b/codes/rust/chapter_array_and_linkedlist/array.rs index 6a96a8e35..3cc8c4cea 100644 --- a/codes/rust/chapter_array_and_linkedlist/array.rs +++ b/codes/rust/chapter_array_and_linkedlist/array.rs @@ -78,7 +78,8 @@ fn main() { print_util::print_array(&arr); // 在 Rust 中,指定长度时([i32; 5])为数组 // 由于 Rust 的数组被设计为在编译期确定长度,因此只能使用常量来指定长度 - // 为了方便实现扩容 extend() 方法,以下将(Vec) 看作数组(Array)也是rust一般情况下使用动态数组的类型 + // Vec 是 Rust 一般情况下使用动态数组的类型 + // 为了方便实现扩容 extend() 方法,以下将 Vec 看作数组(Array) let nums: Vec = vec![1, 3, 2, 5, 4]; print!("\n数组 nums = "); print_util::print_array(&nums); diff --git a/docs/chapter_array_and_linkedlist/array.md b/docs/chapter_array_and_linkedlist/array.md index 27504f31a..e1fd7c150 100755 --- a/docs/chapter_array_and_linkedlist/array.md +++ b/docs/chapter_array_and_linkedlist/array.md @@ -96,8 +96,8 @@ let arr: [i32; 5] = [0; 5]; // [0, 0, 0, 0, 0] // 在 Rust 中,指定长度时([i32; 5])为数组 // 由于 Rust 的数组被设计为在编译期确定长度,因此只能使用常量来指定长度 - // Vec 是 Rust 一般情况下使用动态数组的类型 - // 为了方便实现扩容 extend() 方法,以下将 Vec 看作数组(Array) + // Vector 是 Rust 一般情况下使用动态数组的类型 + // 为了方便实现扩容 extend() 方法,以下将 vector 看作数组(array) let nums: Vec = vec![1, 3, 2, 5, 4]; ``` diff --git a/en/docs/chapter_array_and_linkedlist/array.md b/en/docs/chapter_array_and_linkedlist/array.md index 202d7c53e..e74ab24ea 100755 --- a/en/docs/chapter_array_and_linkedlist/array.md +++ b/en/docs/chapter_array_and_linkedlist/array.md @@ -97,8 +97,8 @@ Arrays can be initialized in two ways depending on the needs: either without ini let slice: &[i32] = [0; 5]; // In Rust, specifying the length ([i32; 5]) denotes an array, while not specifying it (&[i32]) denotes a slice. // Since Rust's arrays are designed to have compile-time fixed length, only constants can be used to specify the length. - // Vec is generally used as dynamic array in Rust - // For convenience in implementing the extend() method, the Vec will be considered as an Array here. + // Vectors are generally used as dynamic arrays in Rust. + // For convenience in implementing the extend() method, the vector will be considered as an array here. let nums: Vec = vec![1, 3, 2, 5, 4]; ``` diff --git a/zh-hant/codes/rust/chapter_array_and_linkedlist/array.rs b/zh-hant/codes/rust/chapter_array_and_linkedlist/array.rs index 866ea3294..d2d57ce2b 100644 --- a/zh-hant/codes/rust/chapter_array_and_linkedlist/array.rs +++ b/zh-hant/codes/rust/chapter_array_and_linkedlist/array.rs @@ -76,9 +76,10 @@ fn main() { let arr: [i32; 5] = [0; 5]; print!("陣列 arr = "); print_util::print_array(&arr); - // 在 Rust 中,指定長度時([i32; 5])為陣列 + // 在 Rust 中,指定長度时([i32; 5])爲陣列,不指定長度時(&[i32])爲切片 // 由於 Rust 的陣列被設計為在編譯期確定長度,因此只能使用常數來指定長度 - // 為了方便實現擴容 extend() 方法,以下將(Vec) 看作陣列(Array)也是rust一般情況下使用動態陣列的型別 + // Vec 是 Rust 一般情況下使用動態陣列的類型 + // 為了方便實現擴容 extend() 方法,以下將 Vec 看作陣列(Array) let nums: Vec = vec![1, 3, 2, 5, 4]; print!("\n陣列 nums = "); print_util::print_array(&nums); diff --git a/zh-hant/docs/chapter_array_and_linkedlist/array.md b/zh-hant/docs/chapter_array_and_linkedlist/array.md index eebc3efbc..1ae9e2c9f 100755 --- a/zh-hant/docs/chapter_array_and_linkedlist/array.md +++ b/zh-hant/docs/chapter_array_and_linkedlist/array.md @@ -97,8 +97,8 @@ let slice: &[i32] = [0; 5]; // 在 Rust 中,指定長度时([i32; 5])爲陣列,不指定長度時(&[i32])爲切片 // 由於 Rust 的陣列被設計為在編譯期確定長度,因此只能使用常數來指定長度 - // Vec 是 Rust 一般情況下使用動態陣列的類型 - // 為了方便實現擴容 extend() 方法,以下將 Vec 看作陣列(Array) + // Vector 是 Rust 一般情況下使用動態陣列的類型 + // 為了方便實現擴容 extend() 方法,以下將 Vec 看作陣列(array) let nums: Vec = vec![1, 3, 2, 5, 4]; ```