Skip to content

Commit 73a5f01

Browse files
committed
Use 0-based idx for array content
1 parent a8e9708 commit 73a5f01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/core/src/option.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1216,10 +1216,10 @@ impl<T> Option<T> {
12161216
/// Often used to chain fallible operations that may return [`None`].
12171217
///
12181218
/// ```
1219-
/// let arr_2d = [["A1", "A2"], ["B1", "B2"]];
1219+
/// let arr_2d = [["A0", "A1"], ["B0", "B1"]];
12201220
///
12211221
/// let item_0_1 = arr_2d.get(0).and_then(|row| row.get(1));
1222-
/// assert_eq!(item_0_1, Some(&"A2"));
1222+
/// assert_eq!(item_0_1, Some(&"A1"));
12231223
///
12241224
/// let item_2_0 = arr_2d.get(2).and_then(|row| row.get(0));
12251225
/// assert_eq!(item_2_0, None);

0 commit comments

Comments
 (0)