Skip to content

Commit ceae9f0

Browse files
committed
docs: Add documentation for Rust arrays and update journal entry
- Introduced a new page detailing Rust arrays, highlighting fixed length and type requirements - Updated the journal entry to include a link to the new arrays documentation
1 parent 958b230 commit ceae9f0

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

journals/2025_11_28.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
- [[Rust/Variable/Type/Compound]]
1616
- [[Rust/Variable/Type/Compound/Tuple]]
1717
- [[Programming/Zero Indexing]]
18-
-
18+
- [[Rust/Variable/Type/Compound/Array]]
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
- unlike [[Rust/Variable/Type/Compound/Tuple]], every element must have the **same type**
2+
- in this aspec it's similar to [[Py/TypedDict]]
3+
- the type can use rust's type inference; you don't need to be explicit. In that sense it's perhaps a bit like python's type checking
4+
- ```rust
5+
fn test_arrays() {
6+
let a = [1, 2, 3, 4, 5];
7+
// rust analyzer will turn this into ...
8+
let a: [i32; 5] = [1, 2, 3, 4, 5];
9+
10+
let months = ["January", "February", "March", "April", "May", "June", "July",
11+
"August", "September", "October", "November", "December"];
12+
13+
}
14+
15+
16+
```
17+
- has a **fixed length**
18+
-

0 commit comments

Comments
 (0)