mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-08-14 06:48:35 +00:00
media_catalog: use stream_position
Fixes the following clippy lint: ``` warning: using `SeekFrom::Current` to start from current position --> src/tape/media_catalog.rs:798:23 | 798 | let pos = file.seek(SeekFrom::Current(0))?; // get current pos | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: replace with: `file.stream_position()` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#seek_from_current = note: `#[warn(clippy::seek_from_current)]` on by default ``` Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
parent
2224b3900d
commit
7b61e06860
@ -1,6 +1,6 @@
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use std::fs::File;
|
||||
use std::io::{BufReader, Read, Seek, SeekFrom, Write};
|
||||
use std::io::{BufReader, Read, Seek, Write};
|
||||
use std::os::unix::io::AsRawFd;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
||||
@ -795,7 +795,7 @@ impl MediaCatalog {
|
||||
let mut media_set_uuid = None;
|
||||
|
||||
loop {
|
||||
let pos = file.seek(SeekFrom::Current(0))?; // get current pos
|
||||
let pos = file.stream_position()?; // get current pos
|
||||
|
||||
if pos == 0 {
|
||||
// read/check magic number
|
||||
|
Loading…
Reference in New Issue
Block a user