Skip to content

Commit

Permalink
remove windows flag
Browse files Browse the repository at this point in the history
  • Loading branch information
kylebarron committed Nov 18, 2024
1 parent 7c9aed7 commit 03de68d
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions object_store/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -895,20 +895,7 @@ pub(crate) fn chunked_stream(
.boxed()
}

#[allow(unused_mut)]
pub(crate) fn read_range(
file: &mut File,
path: &PathBuf,
mut range: Range<usize>,
) -> Result<Bytes> {
// On windows, range requests beyond the end of the file fail, so we shorten the range to not
// go beyond the end.
#[cfg(target_os = "windows")]
{
let file_len = file.seek(SeekFrom::End(0)).context(SeekSnafu { path })?;
range = range.start..range.end.min(file_len as usize);
}

pub(crate) fn read_range(file: &mut File, path: &PathBuf, range: Range<usize>) -> Result<Bytes> {
let to_read = range.end - range.start;
let seek_idx = file
.seek(SeekFrom::Start(range.start as u64))
Expand Down

0 comments on commit 03de68d

Please sign in to comment.