From 9028293a856e6c5ad29b5855096f4b95a015e7cb Mon Sep 17 00:00:00 2001 From: Jan Katzer Date: Mon, 6 Oct 2025 13:45:18 +0200 Subject: [PATCH] Fix all warnings --- 12bitfloat_rust/risspam/src/main.rs | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/12bitfloat_rust/risspam/src/main.rs b/12bitfloat_rust/risspam/src/main.rs index ed04b33..c09a6e5 100644 --- a/12bitfloat_rust/risspam/src/main.rs +++ b/12bitfloat_rust/risspam/src/main.rs @@ -1,26 +1,19 @@ #![feature(likely_unlikely)] #![feature(rust_cold_cc)] +#![allow(dead_code)] + mod books; -use crate::books::FULL_BOOK_PATHS; -use core_affinity::CoreId; -use memmap2::Mmap; use rayon::prelude::*; -use std::cell::OnceCell; use std::cell::RefCell; -use std::ffi::{OsStr, OsString}; -use std::fs::{File, OpenOptions}; -use std::hint::assert_unchecked; +use std::ffi::OsStr; +use std::fs::OpenOptions; use std::io::Read; -use std::mem::MaybeUninit; -use std::ops::Deref; -use std::os::linux::raw::stat; -use std::os::unix::fs::{FileExt, OpenOptionsExt}; use std::sync::Mutex; use std::thread::available_parallelism; use std::time::{Duration, Instant}; -use std::{array, env, fs, hint, mem, process, thread}; +use std::{array, env, hint, process}; #[inline] fn is_ascii_whitespace(b: u8) -> bool { @@ -368,13 +361,13 @@ fn analyze_old(file_path: &OsStr, stats: &mut Stats) { fn main() { // Read in files from args let mut files = Vec::with_capacity(env::args().len()); - let mut do_parallel = false; +// let mut do_parallel = false; let start_time = Instant::now(); for arg in env::args_os().skip(1) { // skip program arg if arg == "-p" { - do_parallel = true; +// do_parallel = true; } else { files.push(arg); } @@ -389,6 +382,7 @@ fn main() { // let tab = FwTab::build(); // Do the work + #[allow(unused_mut)] // SAFETY: We (unsafely) write to this via raw ptrs, it NEEDS to be mut! let mut stats = vec![Stats { sentences: 0, words: 0, @@ -407,7 +401,7 @@ fn main() { // dbg!(num_cores); rayon::ThreadPoolBuilder::new() - .num_threads(num_cores) + .num_threads(num_threads) .build_global() .unwrap();