Skip to content

Commit 99db0da

Browse files
author
Paulo Remoli
committed
fix warnings for windows
1 parent 5e4dfc4 commit 99db0da

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/ingestion/file_reader.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,6 @@ pub struct FileReader {
7979

8080
impl FileReader {
8181
pub fn new(path: &str) -> io::Result<Self> {
82-
use rayon::prelude::*;
83-
8482
let canonical_path = Arc::new(
8583
std::fs::canonicalize(path).unwrap_or_else(|_| std::path::PathBuf::from(path)),
8684
);
@@ -90,6 +88,7 @@ impl FileReader {
9088
// Parallel pread + MADV_POPULATE_WRITE, same as index_chunked.
9189
#[cfg(unix)]
9290
let data: Vec<u8> = {
91+
use rayon::prelude::*;
9392
use std::os::unix::fs::FileExt;
9493
let mut v = vec![0u8; size];
9594
// SAFETY: `v.as_mut_ptr()` is a valid, writable mapping of exactly
@@ -374,9 +373,9 @@ impl FileReader {
374373
let starts = Arc::make_mut(&mut self.line_starts);
375374

376375
// Read only the new bytes via pread and append them to the buffer.
377-
let extra = new_size - old_size;
378376
#[cfg(unix)]
379377
{
378+
let extra = new_size - old_size;
380379
use std::os::unix::fs::FileExt;
381380
let mut buf = vec![0u8; extra];
382381
file.read_at(&mut buf, old_size as u64)?;
@@ -572,7 +571,7 @@ impl FileReader {
572571
v
573572
};
574573
#[cfg(not(unix))]
575-
let mut file_data: Vec<u8> = {
574+
let file_data: Vec<u8> = {
576575
use std::io::Read;
577576
let mut v = Vec::with_capacity(size);
578577
(&*file).read_to_end(&mut v)?;
@@ -1303,6 +1302,7 @@ impl FileReader {
13031302
})
13041303
.await;
13051304

1305+
#[allow(unused_variables)]
13061306
if let Ok(Ok((current_size, ino, dev))) = result {
13071307
// Detect rotation-by-rename: inode changed under the path.
13081308
#[cfg(unix)]

0 commit comments

Comments
 (0)