Skip to content

Commit 79c5445

Browse files
rbradfordlauralt
authored andcommitted
mmap: Fix clippy issue
Replace use of .seek(SeekFrom::Start(0)) with .rewind() to address clippy issue needed for update of rust-vmm-ci. Signed-off-by: Rob Bradford <[email protected]>
1 parent 1696fa6 commit 79c5445

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/mmap.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,7 @@ pub fn check_file_offset(
125125
let filesize = file
126126
.seek(SeekFrom::End(0))
127127
.map_err(MmapRegionError::SeekEnd)?;
128-
file.seek(SeekFrom::Start(0))
129-
.map_err(MmapRegionError::SeekStart)?;
128+
file.rewind().map_err(MmapRegionError::SeekStart)?;
130129
if filesize < end {
131130
return Err(MmapRegionError::MappingPastEof);
132131
}

0 commit comments

Comments
 (0)