mirror of
https://git.proxmox.com/git/proxmox-backup
synced 2025-10-04 17:26:21 +00:00
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:
parent
fd6cdeebea
commit
c4c050dc36
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user