From 6b1e4b83bbb49cdc63bb166f20daa1ce0ea65aa2 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval Date: Wed, 26 Jun 2024 14:43:41 +0200 Subject: [PATCH] http: remove unnecessary cast Fixes the clippy warning: warning: casting to the same type is unnecessary (`usize` -> `usize`) --> proxmox-http/src/websocket/mod.rs:446:40 | 446 | mask.copy_from_slice(&data[mask_offset as usize..payload_offset as usize]); | ^^^^^^^^^^^^^^^^^^^^ help: try: `mask_offset` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast = note: `#[warn(clippy::unnecessary_cast)]` on by default Signed-off-by: Maximiliano Sandoval --- proxmox-http/src/websocket/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/proxmox-http/src/websocket/mod.rs b/proxmox-http/src/websocket/mod.rs index b3179e1f..6d3faea6 100644 --- a/proxmox-http/src/websocket/mod.rs +++ b/proxmox-http/src/websocket/mod.rs @@ -441,7 +441,7 @@ impl FrameHeader { return Ok(None); } let mut mask = [0u8; 4]; - mask.copy_from_slice(&data[mask_offset as usize..payload_offset as usize]); + mask.copy_from_slice(&data[mask_offset..payload_offset as usize]); Some(mask) } else { None