From 21c22be96eef70a66fa065a4dbcca85a3a98630b Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Fri, 22 Dec 2023 09:15:04 +0900 Subject: [PATCH] stacked_table: use u32::from_le_bytes() to reinterpret bytes as integer Apparently, I forgot to update this in fb06e8964902. --- lib/src/stacked_table.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/src/stacked_table.rs b/lib/src/stacked_table.rs index 5e146ac3f..9f1b8789c 100644 --- a/lib/src/stacked_table.rs +++ b/lib/src/stacked_table.rs @@ -182,9 +182,7 @@ impl<'table> ReadonlyTableIndexEntry<'table> { } fn value_offset(&self) -> usize { - (&self.data[self.data.len() - 4..self.data.len()]) - .read_u32::() - .unwrap() as usize + u32::from_le_bytes(self.data[self.data.len() - 4..].try_into().unwrap()) as usize } }