From 929d6b3e7ec42084a6bef14c43debbf4d413fb26 Mon Sep 17 00:00:00 2001 From: timeshifter Date: Thu, 9 Jul 2026 19:54:32 +0200 Subject: [PATCH] fix safety hint --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index c6fff00..69fad18 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,11 +3,11 @@ use memmap2::MmapOptions; fn main() { let file = std::fs::File::open("measurements.txt").unwrap(); - // SAFETY: we are not going to modify the file while the program is running. No lock required - // for now. let mut datas = vec![]; + // SAFETY: we are not going to modify the file while the program is running. No lock required + // for now. let mmap = unsafe { MmapOptions::new().map(&file) }.unwrap(); mmap.advise(memmap2::Advice::Sequential).unwrap();