From c92e3832bf40fa6c62ac32f3355d5440e84e2633 Mon Sep 17 00:00:00 2001 From: Dietmar Maurer Date: Sun, 10 Jan 2021 12:18:30 +0100 Subject: [PATCH] tape: cleanup: s/transfer/transfer_media/, avoid compiler warnings --- src/tape/changer/mod.rs | 6 +++--- src/tape/changer/mtx.rs | 2 +- src/tape/drive/virtual_tape.rs | 6 +++--- src/tape/pool_writer.rs | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/tape/changer/mod.rs b/src/tape/changer/mod.rs index 0125ec13..aa2b35ff 100644 --- a/src/tape/changer/mod.rs +++ b/src/tape/changer/mod.rs @@ -21,7 +21,7 @@ pub trait MediaChange { /// Transfer media from on slot to another (storage or import export slots) /// /// Target slot needs to be empty - fn transfer(&mut self, from: u64, to: u64) -> Result<(), Error>; + fn transfer_media(&mut self, from: u64, to: u64) -> Result<(), Error>; /// Load media from storage slot into drive fn load_media_from_slot(&mut self, slot: u64) -> Result<(), Error>; @@ -102,10 +102,10 @@ pub trait MediaChange { } match (from, to) { (Some(from), Some(to)) => { - self.transfer(from, to); + self.transfer_media(from, to)?; Ok(Some(to)) } - (Some(from), None) => bail!("unable to find free export slot"), + (Some(_from), None) => bail!("unable to find free export slot"), (None, _) => Ok(None), // not online } } diff --git a/src/tape/changer/mtx.rs b/src/tape/changer/mtx.rs index fb009f98..0f5c497b 100644 --- a/src/tape/changer/mtx.rs +++ b/src/tape/changer/mtx.rs @@ -72,7 +72,7 @@ impl MediaChange for MtxMediaChanger { mtx_status(&self.config) } - fn transfer(&mut self, from: u64, to: u64) -> Result<(), Error> { + fn transfer_media(&mut self, from: u64, to: u64) -> Result<(), Error> { mtx_transfer(&self.config.path, from, to) } diff --git a/src/tape/drive/virtual_tape.rs b/src/tape/drive/virtual_tape.rs index 3967388c..998201dc 100644 --- a/src/tape/drive/virtual_tape.rs +++ b/src/tape/drive/virtual_tape.rs @@ -393,7 +393,7 @@ impl MediaChange for VirtualTapeHandle { Ok(MtxStatus { drives, slots }) } - fn transfer(&mut self, from: u64, to: u64) -> Result<(), Error> { + fn transfer_media(&mut self, _from: u64, _to: u64) -> Result<(), Error> { bail!("medfia tranfer is not implemented!"); } @@ -456,9 +456,9 @@ impl MediaChange for VirtualTapeDrive { handle.status() } - fn transfer(&mut self, from: u64, to: u64) -> Result<(), Error> { + fn transfer_media(&mut self, from: u64, to: u64) -> Result<(), Error> { let mut handle = self.open()?; - handle.transfer(from, to) + handle.transfer_media(from, to) } fn load_media_from_slot(&mut self, slot: u64) -> Result<(), Error> { diff --git a/src/tape/pool_writer.rs b/src/tape/pool_writer.rs index d8b9b09a..479e9f6f 100644 --- a/src/tape/pool_writer.rs +++ b/src/tape/pool_writer.rs @@ -128,7 +128,7 @@ impl PoolWriter { /// Export current media set and drop PoolWriterState (close drive) pub fn export_media_set(&mut self, worker: &WorkerTask) -> Result<(), Error> { - let mut status = self.status.take(); + let status = self.status.take(); let (drive_config, _digest) = crate::config::drive::config()?;