From c70173dd37eb90971548c2743fd0027a34540f08 Mon Sep 17 00:00:00 2001 From: Avril Date: Wed, 25 Nov 2020 13:59:30 +0000 Subject: [PATCH] temporary fix compiler warning when building without threads feature --- fcmprs/src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fcmprs/src/main.rs b/fcmprs/src/main.rs index 36fffd6..f40ef71 100644 --- a/fcmprs/src/main.rs +++ b/fcmprs/src/main.rs @@ -2,6 +2,7 @@ #![allow(dead_code)] #[cfg(feature="threads")] use rayon::prelude::*; +#[allow(unused_imports)] use std::{ path::Path, io, fs::{self, OpenOptions,}, @@ -39,7 +40,7 @@ fn main() { std::process::exit({ if let Some(map1) = map::map(&map1).discard_msg(format!("Failed to map file {}", map1)) { let slice = map1.as_slice(); - let map1_sz: u64 = slice.len().try_into().expect("File size could not fit into u64. This should never happen."); + #[cfg(feature="threads")] let map1_sz: u64 = slice.len().try_into().expect("File size could not fit into u64. This should never happen."); // For now, non-threaded mode doesn't use this. let mut ok = true; let chk: SmallVec<[_; 32]> = rest.filter_map(|filename| { let path = Path::new(&filename);