sg_pt_changer: remove needless call to as_bytes()

Fixes:

warning: needless call to `as_bytes()`
   --> pbs-tape/src/sg_pt_changer.rs:913:45
    |
913 |             let rem = SCSI_VOLUME_TAG_LEN - voltag.as_bytes().len();
    |                                             ^^^^^^^^^^^^^^^^^^^^^^^ help: `len()` can be called directly on strings: `voltag.len()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_as_bytes
    = note: `#[warn(clippy::needless_as_bytes)]` on by default

Signed-off-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
This commit is contained in:
Maximiliano Sandoval 2025-01-13 14:25:52 +01:00 committed by Dietmar Maurer
parent fd6cdeebea
commit c4c050dc36

View File

@ -910,7 +910,7 @@ mod test {
if let Some(voltag) = &desc.pvoltag {
res.extend_from_slice(voltag.as_bytes());
let rem = SCSI_VOLUME_TAG_LEN - voltag.as_bytes().len();
let rem = SCSI_VOLUME_TAG_LEN - voltag.len();
if rem > 0 {
res.resize(res.len() + rem, 0);
}